aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-10 21:00:47 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-10 21:00:47 +0000
commitcba9ef5523f09ecc3240f9f6efcdd0440c652c91 (patch)
tree79a2f859df1f6eef15defd02bd2f453735ed327e /libbb
parent1ac42bf66e2c181b886e89f9222cae65676c9e8a (diff)
downloadbusybox-cba9ef5523f09ecc3240f9f6efcdd0440c652c91.tar.gz
fixes from Vladimir Dronnikov <dronnikov@gmail.ru>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xatol.c9
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 @@
#include "libbb.h"
-unsigned long long xatoull(const char *numstr)
+unsigned long long xstrtoull(const char *numstr, int base)
{
unsigned long long r;
int old_errno;
@@ -18,7 +18,7 @@ unsigned long long xatoull(const char *numstr)
bb_error_msg_and_die("invalid number '%s'", numstr);
old_errno = errno;
errno = 0;
- r = strtoull(numstr, &e, 10);
+ r = strtoull(numstr, &e, base);
if (errno || (numstr == e) || *e)
/* Error / no digits / illegal trailing chars */
bb_error_msg_and_die("invalid number '%s'", numstr);
@@ -27,6 +27,11 @@ unsigned long long xatoull(const char *numstr)
return r;
}
+unsigned long long xatoull(const char *numstr)
+{
+ return xstrtoull(numstr, 10);
+}
+
unsigned long xstrtoul_range_sfx(const char *numstr, int base,
unsigned long lower,
unsigned long upper,