libc: atoi() is supposed to return 0 if handed a NULL pointer

Change-Id: I2d77532536ca83e5c9c2d7622a0e672082969f75
This commit is contained in:
Solomon Peachy 2021-07-24 11:31:07 -04:00
parent 2e9443104f
commit 7318d393ea
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ int atoi (const char *str)
{
int value = 0;
int sign = 1;
if (!str)
return 0;
while (isspace(*str))
{
str++;