aboutsummaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-02-20 13:45:07 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-02-23 13:35:50 +1100
commit2d9cfc99ce6d1bd77e6dd722858147b78dd3962d (patch)
treeb487c8285efe1dfd53fc94377312ce962b062e3f /libc/stdlib
parente4f5a453bb4e8b9ee3820c0f495beff417a867de (diff)
downloadskiboot-2d9cfc99ce6d1bd77e6dd722858147b78dd3962d.zip
skiboot-2d9cfc99ce6d1bd77e6dd722858147b78dd3962d.tar.gz
skiboot-2d9cfc99ce6d1bd77e6dd722858147b78dd3962d.tar.bz2
atoi/atol should assume base 10, not autodetect base.
The behaviour of atoi/atol on glibc (and according to the spec) is to assume base 10, not to autodetect the base. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/atoi.c2
-rw-r--r--libc/stdlib/atol.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libc/stdlib/atoi.c b/libc/stdlib/atoi.c
index d2fb33b..444c05a 100644
--- a/libc/stdlib/atoi.c
+++ b/libc/stdlib/atoi.c
@@ -14,5 +14,5 @@
int atoi(const char *str)
{
- return strtol(str, NULL, 0);
+ return strtol(str, NULL, 10);
}
diff --git a/libc/stdlib/atol.c b/libc/stdlib/atol.c
index a6aa47b..e73c7d4 100644
--- a/libc/stdlib/atol.c
+++ b/libc/stdlib/atol.c
@@ -14,5 +14,5 @@
long atol(const char *str)
{
- return strtol(str, NULL, 0);
+ return strtol(str, NULL, 10);
}