Skip site navigation (1)Skip section navigation (2)
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/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=237699

--- 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 = ksprintn(nbuf, num, base, &n, upper);
                        tmp = 0;
                        if (sharpflag && num != 0) {
                                if (base == 8)
                                        tmp++;
                                else if (base == 16)
                                        tmp += 2;
                        }

That's where your two missing characters are going.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237699-227-iCrKyxc61H>