diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2018-10-19 15:25:41 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2018-10-19 15:27:42 +0200 |
commit | 3db4e7f84cf795de8559ea0d96eaa491999ccf24 (patch) | |
tree | 0260c160e82214f81dc2aeaef7764e4bb0c632ef /libbb | |
parent | 7effa31cd4b5c76d20f63882002eb023f05aaa46 (diff) | |
download | busybox-w32-3db4e7f84cf795de8559ea0d96eaa491999ccf24.tar.gz busybox-w32-3db4e7f84cf795de8559ea0d96eaa491999ccf24.tar.bz2 busybox-w32-3db4e7f84cf795de8559ea0d96eaa491999ccf24.zip |
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>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/bb_strtonum.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/bb_strtonum.c b/libbb/bb_strtonum.c index 2185017b0..cb70f1053 100644 --- a/libbb/bb_strtonum.c +++ b/libbb/bb_strtonum.c | |||
@@ -81,7 +81,7 @@ long long FAST_FUNC bb_strtoll(const char *arg, char **endp, int base) | |||
81 | /* Check for the weird "feature": | 81 | /* Check for the weird "feature": |
82 | * a "-" string is apparently a valid "number" for strto[u]l[l]! | 82 | * a "-" string is apparently a valid "number" for strto[u]l[l]! |
83 | * It returns zero and errno is 0! :( */ | 83 | * It returns zero and errno is 0! :( */ |
84 | first = (arg[0] != '-' ? arg[0] : arg[1]); | 84 | first = (arg[0] != '-' && arg[0] != '+' ? arg[0] : arg[1]); |
85 | if (!isalnum(first)) return ret_ERANGE(); | 85 | if (!isalnum(first)) return ret_ERANGE(); |
86 | 86 | ||
87 | errno = 0; | 87 | errno = 0; |