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