There are some problems with a precision of 0 (an annoying corner case).
The following crash:
printf("% .0d", 0); (should output )
printf("%+.0d", 0); (should output +)
This is caused by decrementing a 0 len here: https://github.com/mpaland/printf/blob/master/printf.c#L185
printf("%#.0x", 0); is apparently supposed to output an empty string, not 0x. The octal case is correct, though. It seems this was clarified in C11.
There are some problems with a precision of 0 (an annoying corner case).
The following crash:
printf("% .0d", 0);(should output)printf("%+.0d", 0);(should output+)This is caused by decrementing a 0
lenhere: https://github.com/mpaland/printf/blob/master/printf.c#L185printf("%#.0x", 0);is apparently supposed to output an empty string, not0x. The octal case is correct, though. It seems this was clarified in C11.