mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
afs-snrpintf-support-percentp-for-ptrs-20090616
LICENSE IPL10 so we can portably log pointers
This commit is contained in:
parent
82d9807e22
commit
a44bee5615
@ -347,6 +347,26 @@ afs_vsnprintf(char *p, size_t avail, const char *fmt, va_list ap)
|
||||
len = strlen(x);
|
||||
break;
|
||||
|
||||
case 'p': /* unsigned decimal integer */
|
||||
UVAL = va_arg(ap, void *);
|
||||
|
||||
xbuf[0] = '0';
|
||||
xbuf[1] = 'x';
|
||||
|
||||
if (!haveprec) {
|
||||
if (zfill && !ljust)
|
||||
precision = width;
|
||||
else
|
||||
precision = 1;
|
||||
}
|
||||
if (precision > MAXPREC)
|
||||
precision = MAXPREC;
|
||||
|
||||
mkint(xbuf + 2, UVAL, 16, 0, precision);
|
||||
x = xbuf + ((altform && UVAL) ? 0 : 2);
|
||||
len = strlen(x);
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
case 'X': /* unsigned hexadecimal integer */
|
||||
if (lflag > 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user