libc/stdlib: If there were no digits at all, strtoul() stores the original value of nptr in *endptr (and returns 0).

Reference: STRTOUL(3)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3
2023-12-26 11:21:43 +08:00
committed by Xiang Xiao
parent 9773fb9867
commit 02f1503f9f
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ bool lib_isbasedigit(int ch, int base, int *value)
}
}
if (value)
if (ret && value)
{
*value = tmp;
}