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
path: root/src/stdio/vswscanf.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012年04月17日 23:08:58 -0400
committerRich Felker <dalias@aerifal.cx>2012年04月17日 23:08:58 -0400
commita12aa2918535fd370419bd24b50a33974091c5a7 (patch)
tree1a3f5c791708fcbd89f15248e57f8d24bff9004d /src/stdio/vswscanf.c
parent2dd5dc78d4502381e2933137ed525acf339cb383 (diff)
downloadmusl-a12aa2918535fd370419bd24b50a33974091c5a7.tar.gz
fix failure to distinguish input/match failure in wide %[ scanf
this also includes a related fix for vswscanf's read function, which was returning a spurious (uninitialized) character for empty strings.
Diffstat (limited to 'src/stdio/vswscanf.c')
-rw-r--r--src/stdio/vswscanf.c 2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/vswscanf.c b/src/stdio/vswscanf.c
index 4396d7df..4c39f806 100644
--- a/src/stdio/vswscanf.c
+++ b/src/stdio/vswscanf.c
@@ -17,7 +17,7 @@ static size_t wstring_read(FILE *f, unsigned char *buf, size_t len)
f->rend = f->buf + k;
f->cookie = (void *)src;
- if (!len) return 0;
+ if (!len || !k) return 0;
*buf = *f->rpos++;
return 1;
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月06日 00:11:50 +0000

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