mirror of https://git.musl-libc.org/git/musl
Browse Source
commitmastera90d9da1d1made 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 commit511d70738bmade it do so. thus, there is no longer any need for fgetws to poke at errno to handle encoding errors. this commit reverts commita90d9da1d1and thereby fixes the problem.
1 changed files with 1 additions and 6 deletions
Loading…
Reference in new issue