[PATCH v4 1/2] msvcrt: Don't set error in wcstombs_s_l if no characters to convert.
5 Feb
5 Feb
3:32 p.m.
On 2/5/20 3:39 PM, Daniel Lehman wrote: if(!mbstr) { tmp = WideCharToMultiByte(locinfo->lc_codepage, WC_NO_BEST_FIT_CHARS, - *wcstr, -1, NULL, 0, NULL, &used_default)-1; - if(!tmp || used_default) { + *wcstr, -1, NULL, 0, NULL, &used_default); + if(used_default) { *MSVCRT__errno() = MSVCRT_EILSEQ; return -1; } I think we should still set errno when WideCharToMultiByte fails (the !tmp case). Thanks, Piotr
2228
Age (days ago)
2228
Last active (days ago)
1 comments
2 participants
participants (2)
-
Daniel Lehman -
Piotr Caban