mpaland / printf

Tiny, fast, non-dependent and fully loaded printf implementation for embedded systems. Extensive test suite passing.
MIT License
2.49k stars 457 forks source link

printf("%#.5o", 06143), printf("%#.0o", 0) #53

Open ledvinap opened 5 years ago

ledvinap commented 5 years ago

In this case (and wider precision) octal zero should be included in padding instead of adding it

printf("%#.5o", 06143)
expected: 06143
got: 006143

printf("%#.6o", 06143)
expected: 006143
got: 0006143

another partially-related case is


sprintf("%#.0o", 0)
glibc: "0"
got: ""
eyalroz commented 3 years ago

Should be fixed on my fork with 6a3ad44f895137c6fba7198fcb6b8acef80f2b51; see also #109.