Skip to content

Conversation

frendsick
Copy link
Contributor

When printing hex number, with 0 padding, the extra zeros go in between 0x and the digits. We put them at the beginning:

env printf "%#06x\n" 123
0x007b
$ ./coreutils-main printf "%#06x\n" 123
000x7b

Fixes: #7510

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

@RenjiSann RenjiSann merged commit 625e5ee into uutils:main Jun 14, 2025
75 checks passed
@frendsick frendsick deleted the fix/printf-hex-zero-padding branch June 14, 2025 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

printf: Alternate hex representation with 0 padding puts the padding at the incorrect place
2 participants