summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
{
int value = 0;
int sign = 1;
-
+
+ if (!str)
+ return 0;
+
while (isspace(*str))
{
str++;