Commit c4ab42d8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix C locale handling in wcstombs.

parent f091d9ed
......@@ -477,6 +477,24 @@ static MSVCRT_size_t MSVCRT_wcsrtombs_l(char *mbstr, const MSVCRT_wchar_t **wcst
else
locinfo = locale->locinfo;
if(!locinfo->lc_codepage) {
MSVCRT_size_t i;
if(!mbstr)
return strlenW(*wcstr);
for(i=0; i<count; i++) {
if((*wcstr)[i] > 255) {
*MSVCRT__errno() = MSVCRT_EILSEQ;
return -1;
}
mbstr[i] = (*wcstr)[i];
if(!(*wcstr)[i]) break;
}
return i;
}
if(!mbstr) {
tmp = WideCharToMultiByte(locinfo->lc_codepage, WC_NO_BEST_FIT_CHARS,
*wcstr, -1, NULL, 0, NULL, &used_default)-1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment