[PATCH v3 2/3] msvcrt: Don't set error in wcstombs_s_l if no characters to convert.
4 Feb
4 Feb
11 a.m.
Hi Daniel, On 2/3/20 11:45 PM, Daniel Lehman wrote: tmp = WideCharToMultiByte(locinfo->lc_codepage, WC_NO_BEST_FIT_CHARS, *wcstr, -1, NULL, 0, NULL, &used_default)-1; + if(!tmp && !count) + return 0; if(!tmp || used_default) { We're currently incorrectly checking for WideCharToMultiByte failure. tmp equals to WideCharToMultiByte()-1, so we should check if tmp==-1 instead of !tmp (or preferably store WideCharToMultiByte return value in tmp). Thanks, Piotr
2141
Age (days ago)
2142
Last active (days ago)
1 comments
2 participants
participants (2)
-
Daniel Lehman -
Piotr Caban