coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

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

Open drinkcat opened this issue 7 months ago • 1 comments

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

drinkcat avatar Mar 20 '25 16:03 drinkcat