23 Aug
2024
23 Aug
'24
4:56 p.m.
Alexandre Julliard (@julliard) commented about dlls/mlang/mlang.c:
default: if (*pcSrcSize == -1) *pcSrcSize = lstrlenA(pSrcStr); - + while (MultiByteToWideChar(dwEncoding, MB_ERR_INVALID_CHARS, pSrcStr, *pcSrcSize, 0, 0) == 0) + { + (*pcSrcSize)--; + }
This will truncate at the first invalid char, it would need a test to show that this is the correct behavior. Also it won't do the right thing for a zero-length string. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6294#note_79775