From 2daad6ede8edcccfb6876dc100b4d736e191002d Mon Sep 17 00:00:00 2001 From: Matheus Afonso Martins Moreira Date: Thu, 2 Nov 2023 20:36:58 -0300 Subject: [PATCH] vcscanf: buffer the ')' of "nan(whatever)" For some reason I thought the do while (c = BUFFER ...) loop already did it for me. Apparently not! --- libc/stdio/vcscanf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/stdio/vcscanf.c b/libc/stdio/vcscanf.c index b2bcc1b9c..ec88a0e0b 100644 --- a/libc/stdio/vcscanf.c +++ b/libc/stdio/vcscanf.c @@ -364,6 +364,9 @@ int __vcscanf(int callback(void *), // goto Done; } } while ((c = BUFFER) != -1 && c != ')'); + if (c == ')') { + c = BUFFER; + } fp = strtod((char *) buf, NULL); goto GotFloatingPointNumber; } else {