@@ -3547,8 +3547,6 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
char *s = (char *)va_arg(args, char *);
if (field_width == -1)
field_width = SHRT_MAX;
- /* first, skip leading white space in buffer */
- str = skip_spaces(str);
/* now copy until next white space */
while (*str && !isspace(*str) && field_width--)
@@ -3635,11 +3633,7 @@ int vsscanf(const char *buf, const char *fmt, va_list args)
return num;
}
- /* have some sort of integer conversion.
- * first, skip white space in buffer.
- */
- str = skip_spaces(str);
-
+ /* have some sort of integer conversion. */
digit = *str;
if (is_sign && digit == '-') {
if (field_width == 1)
Passing spaces before e.g. an integer is usually not intended. This was suggested by Christoph in https://lore.kernel.org/lkml/ZIQrohcizoj4bZWx@infradead.org/. Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com> --- lib/vsprintf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)