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/fgetwc.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2017年11月18日 17:51:48 +0100
committerRich Felker <dalias@aerifal.cx>2017年11月18日 20:11:08 -0500
commit72656157f54c47277b01ec85a6ba7c4084fea6c8 (patch)
tree971a42bacaaae0a5f48f3b72d59ad6b7aeae3666 /src/stdio/fgetwc.c
parenta223dbd27ae36fe53f9f67f86caf685b729593fc (diff)
downloadmusl-72656157f54c47277b01ec85a6ba7c4084fea6c8.tar.gz
fix fgetwc when decoding a character that crosses buffer boundary
Update the buffer position according to the bytes consumed into st when decoding an incomplete character at the end of the buffer.
Diffstat (limited to 'src/stdio/fgetwc.c')
-rw-r--r--src/stdio/fgetwc.c 1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/fgetwc.c b/src/stdio/fgetwc.c
index e455cfec..a00c1a86 100644
--- a/src/stdio/fgetwc.c
+++ b/src/stdio/fgetwc.c
@@ -22,6 +22,7 @@ static wint_t __fgetwc_unlocked_internal(FILE *f)
f->rpos++;
return WEOF;
}
+ f->rpos = f->rend;
} else l = -2;
/* Convert character byte-by-byte */
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月07日 00:25:27 +0000

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