git://git.openafs.org
/
openafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
ce6d83d
)
snprintf-ip-printing-20040826
author
Rainer Toebbicke
<rtb@pclella.cern.ch>
Thu, 26 Aug 2004 18:45:59 +0000 (18:45 +0000)
committer
Derrick Brashear
<shadow@dementia.org>
Thu, 26 Aug 2004 18:45:59 +0000 (18:45 +0000)
don't treat ip address as long long, cast to 32 bit...
src/util/snprintf.c
patch
|
blob
|
history
diff --git
a/src/util/snprintf.c
b/src/util/snprintf.c
index
0d80408
..
603d174
100644
(file)
--- a/
src/util/snprintf.c
+++ b/
src/util/snprintf.c
@@
-436,9
+436,11
@@
afs_vsnprintf(char *p, size_t avail, const char *fmt, va_list ap)
} else {
x = "%u.%u.%u.%u";
}
- sprintf(xbuf, x, (UVAL & 0xff000000) >> 24,
- (UVAL & 0x00ff0000) >> 16, (UVAL & 0x0000ff00) >> 8,
- (UVAL & 0x000000ff));
+ /* typecast to whatever '%u' is! */
+ sprintf(xbuf, x, (unsigned int)((UVAL & 0xff000000) >> 24),
+ (unsigned int)((UVAL & 0x00ff0000) >> 16),
+ (unsigned int)((UVAL & 0x0000ff00) >> 8),
+ (unsigned int)(UVAL & 0x000000ff));
x = xbuf;
len = strlen(xbuf);
}