diff options
author | Rob Landley <rob@landley.net> | 2016-07-13 13:46:50 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-07-13 13:46:50 -0500 |
commit | 93e044c4a68d55266db108a24fb70d9de46eab14 (patch) | |
tree | 2873a059e5cfa7fd564b51bffd06960131ffa43a /lib | |
parent | 76cc2e2bcddef47176dfeef59c5d4ba28880f219 (diff) | |
download | toybox-93e044c4a68d55266db108a24fb70d9de46eab14.tar.gz |
Bugfix: suffixless string was feeding terminating NUL to strchr() and matching.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -297,7 +297,7 @@ long long atolx(char *numstr) long long val; val = xstrtol(numstr, &c, 0); - if (c != numstr && (end = strchr(suffixes, tolower(*c)))) { + if (c != numstr && *c && (end = strchr(suffixes, tolower(*c)))) { int shift = end-suffixes-2; if (shift >= 0) { |