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@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; }