libc: fix silly comparison mistake in scanf

This commit is contained in:
K. Lange 2018-11-23 10:41:45 +09:00
parent de7463d141
commit eeff7d7db9

View File

@ -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++;
}