summaryrefslogtreecommitdiff
path: root/firmware/libc/atoi.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-07-24 11:31:07 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-07-30 01:41:13 +0000
commit7318d393eafef5eaecffb74214767c0b15261b0b (patch)
tree5d358f8c012b480f79f718ed6e1e7dcc7793285b /firmware/libc/atoi.c
parent2e9443104fbc4a83e130c44b2e8702d0dda1bd82 (diff)
downloadrockbox-7318d393eafef5eaecffb74214767c0b15261b0b.tar.gz
rockbox-7318d393eafef5eaecffb74214767c0b15261b0b.zip
libc: atoi() is supposed to return 0 if handed a NULL pointer
Change-Id: I2d77532536ca83e5c9c2d7622a0e672082969f75
Diffstat (limited to 'firmware/libc/atoi.c')
-rw-r--r--firmware/libc/atoi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/libc/atoi.c b/firmware/libc/atoi.c
index 3393839b27..00617c3d13 100644
--- a/firmware/libc/atoi.c
+++ b/firmware/libc/atoi.c
@@ -26,7 +26,10 @@ int atoi (const char *str)
26{ 26{
27 int value = 0; 27 int value = 0;
28 int sign = 1; 28 int sign = 1;
29 29
30 if (!str)
31 return 0;
32
30 while (isspace(*str)) 33 while (isspace(*str))
31 { 34 {
32 str++; 35 str++;