diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 6c56c62fd9a5..af307588ad8b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -3526,8 +3526,12 @@ int vsscanf(const char *buf, const char *fmt, va_list args) str = skip_spaces(str); digit = *str; - if (is_sign && digit == '-') + if (is_sign && digit == '-') { + if (field_width == 1) + break; + digit = *(str + 1); + } if (!digit || (base == 16 && !isxdigit(digit))