libc: fix silly comparison mistake in scanf
This commit is contained in:
parent
de7463d141
commit
eeff7d7db9
@ -35,7 +35,7 @@ int vsscanf(const char *str, const char *format, va_list ap) {
|
||||
sign = -1;
|
||||
str++;
|
||||
}
|
||||
while (*str && *str > '0' && *str < '9') {
|
||||
while (*str && *str >= '0' && *str <= '9') {
|
||||
i = i * 10 + *str - '0';
|
||||
str++;
|
||||
}
|
||||
@ -45,7 +45,7 @@ int vsscanf(const char *str, const char *format, va_list ap) {
|
||||
*out = i * sign;
|
||||
} else if (*format == 'u') {
|
||||
unsigned int i = 0;
|
||||
while (*str && *str > '0' && *str < '9') {
|
||||
while (*str && *str >= '0' && *str <= '9') {
|
||||
i = i * 10 + *str - '0';
|
||||
str++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user