diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-10 21:00:47 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-10 21:00:47 +0000 |
| commit | cba9ef5523f09ecc3240f9f6efcdd0440c652c91 (patch) | |
| tree | 79a2f859df1f6eef15defd02bd2f453735ed327e /libbb | |
| parent | 1ac42bf66e2c181b886e89f9222cae65676c9e8a (diff) | |
| download | busybox-w32-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.tar.gz busybox-w32-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.tar.bz2 busybox-w32-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.zip | |
fixes from Vladimir Dronnikov <dronnikov@gmail.ru>
Diffstat (limited to 'libbb')
| -rw-r--r-- | libbb/xatol.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libbb/xatol.c b/libbb/xatol.c index 3316c3d06..1b71e9ca8 100644 --- a/libbb/xatol.c +++ b/libbb/xatol.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include "libbb.h" | 10 | #include "libbb.h" |
| 11 | 11 | ||
| 12 | unsigned long long xatoull(const char *numstr) | 12 | unsigned long long xstrtoull(const char *numstr, int base) |
| 13 | { | 13 | { |
| 14 | unsigned long long r; | 14 | unsigned long long r; |
| 15 | int old_errno; | 15 | int old_errno; |
| @@ -18,7 +18,7 @@ unsigned long long xatoull(const char *numstr) | |||
| 18 | bb_error_msg_and_die("invalid number '%s'", numstr); | 18 | bb_error_msg_and_die("invalid number '%s'", numstr); |
| 19 | old_errno = errno; | 19 | old_errno = errno; |
| 20 | errno = 0; | 20 | errno = 0; |
| 21 | r = strtoull(numstr, &e, 10); | 21 | r = strtoull(numstr, &e, base); |
| 22 | if (errno || (numstr == e) || *e) | 22 | if (errno || (numstr == e) || *e) |
| 23 | /* Error / no digits / illegal trailing chars */ | 23 | /* Error / no digits / illegal trailing chars */ |
| 24 | bb_error_msg_and_die("invalid number '%s'", numstr); | 24 | bb_error_msg_and_die("invalid number '%s'", numstr); |
| @@ -27,6 +27,11 @@ unsigned long long xatoull(const char *numstr) | |||
| 27 | return r; | 27 | return r; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | unsigned long long xatoull(const char *numstr) | ||
| 31 | { | ||
| 32 | return xstrtoull(numstr, 10); | ||
| 33 | } | ||
| 34 | |||
| 30 | unsigned long xstrtoul_range_sfx(const char *numstr, int base, | 35 | unsigned long xstrtoul_range_sfx(const char *numstr, int base, |
| 31 | unsigned long lower, | 36 | unsigned long lower, |
| 32 | unsigned long upper, | 37 | unsigned long upper, |
