[PATCH 1/1] msvcrt: Null widechar pointer when wcsrtombs_l() is successful.
Mimic how the function works on Windows. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50698 Signed-off-by: Bernhard Kölbl <besentv(a)gmail.com> --- dlls/msvcrt/wcs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 9a30e0fe149..7c8f50891cc 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -610,6 +610,7 @@ static size_t wcsrtombs_l(char *mbstr, const wchar_t **wcstr, mbstr[i] = (*wcstr)[i]; if(!(*wcstr)[i]) break; } + *wcstr = NULL; return i; } @@ -645,8 +646,9 @@ static size_t wcsrtombs_l(char *mbstr, const wchar_t **wcstr, if(tmp < count) { mbstr[tmp] = '\0'; - *wcstr = NULL; } + + *wcstr = NULL; return tmp; } -- 2.30.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=86189 Your paranoid android. === debiant2 (32 bit report) === msvcrt: string.c:2183: Test failed: pwstr = 00000000 (wszSimple = 00466F50) === debiant2 (32 bit Chinese:China report) === msvcrt: string.c:2183: Test failed: pwstr = 00000000 (wszSimple = 00466F50) === debiant2 (32 bit WoW report) === msvcrt: string.c:2183: Test failed: pwstr = 00000000 (wszSimple = 00466F50) === debiant2 (64 bit WoW report) === msvcrt: string.c:2183: Test failed: pwstr = 00000000 (wszSimple = 00466F50)
Hi Bernhard, I've sent an updated version of you patch. It changes the function behavior only for C locale. Thanks, Piotr
participants (3)
-
Bernhard Kölbl -
Marvin -
Piotr Caban