Date: Thu, 02 May 2019 00:55:07 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 237699] Hex printing with subr_prf cuts off zero-padded MSB Message-ID: <bug-237699-227-iCrKyxc61H@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-237699-227@https.bugs.freebsd.org/bugzilla/> References: <bug-237699-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237699 --- Comment #2 from Conrad Meyer <cem@freebsd.org> --- For better or worse, our printf(9) includes the "0x" of '#' in the "width" specification: https://github.com/freebsd/freebsd/blob/master/sys/kern/subr_prf.c#L894 p =3D ksprintn(nbuf, num, base, &n, upper); tmp =3D 0; if (sharpflag && num !=3D 0) { if (base =3D=3D 8) tmp++; else if (base =3D=3D 16) tmp +=3D 2; } That's where your two missing characters are going. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237699-227-iCrKyxc61H>