musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012年06月07日 22:52:41 -0400
committerRich Felker <dalias@aerifal.cx>2012年06月07日 22:52:41 -0400
commit31eaad4796b9da459b15da70097c2b619fb01ea9 (patch)
tree16751ce7f5325eff7137e89ed01772399a69b2b3
parent498a100d05666024fd0d409a27709a03e7e58dd3 (diff)
downloadmusl-31eaad4796b9da459b15da70097c2b619fb01ea9.tar.gz
fix scanf bug reading literals after width-limited field
the field width limit was not being cleared before reading the literal, causing spurious failures in scanf in cases like "%2d:" scanning "00:".
Diffstat
-rw-r--r--src/stdio/vfscanf.c 1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/vfscanf.c b/src/stdio/vfscanf.c
index 64fa9754..61b0edb1 100644
--- a/src/stdio/vfscanf.c
+++ b/src/stdio/vfscanf.c
@@ -103,6 +103,7 @@ int vfscanf(FILE *f, const char *fmt, va_list ap)
}
if (*p != '%' || p[1] == '%') {
p += *p=='%';
+ shlim(f, 0);
c = shgetc(f);
if (c!=*p) {
shunget(f);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月14日 22:08:04 +0000

AltStyle によって変換されたページ (->オリジナル) /