diff options
| author | Daniel Axtens <dja@axtens.net> | 2015-02-20 13:45:07 +1100 |
|---|---|---|
| committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-02-23 13:35:50 +1100 |
| commit | 2d9cfc99ce6d1bd77e6dd722858147b78dd3962d (patch) | |
| tree | b487c8285efe1dfd53fc94377312ce962b062e3f /libc/stdlib | |
| parent | e4f5a453bb4e8b9ee3820c0f495beff417a867de (diff) | |
| download | talos-skiboot-2d9cfc99ce6d1bd77e6dd722858147b78dd3962d.tar.gz talos-skiboot-2d9cfc99ce6d1bd77e6dd722858147b78dd3962d.zip | |
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.c | 2 | ||||
| -rw-r--r-- | libc/stdlib/atol.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libc/stdlib/atoi.c b/libc/stdlib/atoi.c index d2fb33b8..444c05a1 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 a6aa47ba..e73c7d47 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); } |

