printf: fix printing +-prefixed numbers
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 19 Oct 2018 13:25:41 +0000 (15:25 +0200)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 19 Oct 2018 13:27:42 +0000 (15:27 +0200)
commit3db4e7f84cf795de8559ea0d96eaa491999ccf24
tree0260c160e82214f81dc2aeaef7764e4bb0c632ef
parent7effa31cd4b5c76d20f63882002eb023f05aaa46
printf: fix printing +-prefixed numbers

Thanks to Cristian Ionescu-Idbohrn for noticing.

Also fix "%d" '  42' to skip leading whitespace.

function                                             old     new   delta
print_direc                                          435     454     +19
bb_strtoll                                            99     103      +4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 23/0)               Total: 23 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
coreutils/printf.c
libbb/bb_strtonum.c
testsuite/printf.tests