From 0d8a5123084a878e01c4f3081f5e936889cee683 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 19 Dec 2018 14:53:32 +0900 Subject: [PATCH] libc: break from scanf on failed non-whitespace match --- libc/stdio/scanf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c index 14fd1e98..c98c47f6 100644 --- a/libc/stdio/scanf.c +++ b/libc/stdio/scanf.c @@ -58,6 +58,8 @@ int vsscanf(const char *str, const char *format, va_list ap) { /* Expect exact character? */ if (*str == *format) { str++; + } else { + break; } } format++;