about summary refs log tree commit diff
path: root/src/string/strcat.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2022-02-20 20:11:14 -0500
committerRich Felker <dalias@aerifal.cx>2022-02-20 20:21:06 -0500
commitf8bdc3048216f41eaaf655524fa286cfb1184a70 (patch)
tree70ce8e06a28fc69a1e25035e780e125fd8075010 /src/string/strcat.c
parent5690668a1bb9f551bb78d825bc804dcebe84b7e7 (diff)
downloadmusl-f8bdc3048216f41eaaf655524fa286cfb1184a70.tar.gz
musl-f8bdc3048216f41eaaf655524fa286cfb1184a70.tar.xz
musl-f8bdc3048216f41eaaf655524fa286cfb1184a70.zip
fix spurious failures by fgetws when buffer ends with partial character
commit a90d9da1d1b14d81c4f93e1a6d1a686c3312e4ba made fgetws look for
changes to errno by fgetwc to detect encoding errors, since ISO C did
not allow the implementation to set the stream's error flag in this
case, and the fgetwc interface did not admit any other way to detect
the error. however, the possibility of fgetwc setting errno to EILSEQ
in the success path was overlooked, and in fact this can happen if the
buffer ends with a partial character, causing mbtowc to be called with
only part of the character available.

since that change was made, the C standard was amended to specify that
fgetwc set the stream error flag on encoding errors, and commit
511d70738bce11a67219d0132ce725c323d00e4e made it do so. thus, there is
no longer any need for fgetws to poke at errno to handle encoding
errors.

this commit reverts commit a90d9da1d1b14d81c4f93e1a6d1a686c3312e4ba
and thereby fixes the problem.
Diffstat (limited to 'src/string/strcat.c')
0 files changed, 0 insertions, 0 deletions