Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151176554
D1196.id2468.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D1196.id2468.diff
View Options
Index: usr.bin/locate/locate/util.c
===================================================================
--- usr.bin/locate/locate/util.c
+++ usr.bin/locate/locate/util.c
@@ -235,7 +235,7 @@
char buf[INTSIZE];
int i;
} u;
- register int i;
+ register int i, hi;
for (i = 0; i < (int)INTSIZE; i++)
u.buf[i] = *p++;
@@ -243,10 +243,11 @@
i = u.i;
if (i > MAXPATHLEN || i < -(MAXPATHLEN)) {
- i = ntohl(i);
- if (i > MAXPATHLEN || i < -(MAXPATHLEN))
+ hi = ntohl(i);
+ if (hi > MAXPATHLEN || hi < -(MAXPATHLEN))
errx(1, "integer out of +-MAXPATHLEN (%d): %u",
- MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
+ MAXPATHLEN, abs(i) < abs(hi) ? i : hi);
+ return(hi);
}
return(i);
}
@@ -263,16 +264,16 @@
getwf(fp)
FILE *fp;
{
- register int word;
+ register int word, hword;
word = getw(fp);
if (word > MAXPATHLEN || word < -(MAXPATHLEN)) {
- word = ntohl(word);
- if (word > MAXPATHLEN || word < -(MAXPATHLEN))
+ hword = ntohl(word);
+ if (hword > MAXPATHLEN || hword < -(MAXPATHLEN))
errx(1, "integer out of +-MAXPATHLEN (%d): %u",
- MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
- htonl(word));
+ MAXPATHLEN, abs(word) < abs(hword) ? word : hword);
+ return(hword);
}
return(word);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 2:57 PM (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31038294
Default Alt Text
D1196.id2468.diff (1 KB)
Attached To
Mode
D1196: Fix clang 3.5.0 warning in usr.bin/locate
Attached
Detach File
Event Timeline
Log In to Comment