1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Account for octal marker in %#o format

This commit is contained in:
Andreas Schwab
2023-01-27 23:25:59 +01:00
parent 90dffec958
commit 2f39e44a84
3 changed files with 56 additions and 0 deletions

View File

@ -196,6 +196,9 @@ LABEL (unsigned_number): /* Unsigned number of base BASE. */
/* Account for 0X, 0x, 0B or 0b hex or binary marker. */
width -= 2;
if (octal_marker)
--width;
if (is_negative || showsign || space)
--width;
@ -257,6 +260,9 @@ LABEL (unsigned_number): /* Unsigned number of base BASE. */
width -= 2;
}
if (octal_marker)
--width;
width -= workend - string + prec;
Xprintf_buffer_pad (buf, L_('0'), prec);