diff options
author | jhb <jhb@FreeBSD.org> | 2003-01-07 18:17:18 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-01-07 18:17:18 +0000 |
commit | 09a741fae61bb411204d6d533ec4670c5f416c37 (patch) | |
tree | 8ef9b9c11f98393949e0f5d5f54fac1d2b811aa9 /sys | |
parent | 3f028c0665d25ad4ded3255452023bb4fbfeea34 (diff) | |
download | FreeBSD-src-09a741fae61bb411204d6d533ec4670c5f416c37.zip FreeBSD-src-09a741fae61bb411204d6d533ec4670c5f416c37.tar.gz |
Cast the integer read as the first argument for %b to an unsigned integer
so it's value is not sign extended when assigned to the uintmax_t variable
used internally by printf. For example, if bit 31 is set in the cpuid
feature word, then %b would print out the initial value as a 16 character
hexadecimal value. Now it only prints out an 8 character value.
Reviewed by: bde
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_prf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 8e1c7b8..5f299f9 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -560,7 +560,7 @@ reswitch: switch (ch = (u_char)*fmt++) { width = n; goto reswitch; case 'b': - num = va_arg(ap, int); + num = (u_int)va_arg(ap, int); p = va_arg(ap, char *); for (q = ksprintn(nbuf, num, *p++, NULL); *q;) PCHAR(*q--); |