[PATCH 1/3] libs/port: Make wine_utf8_wcstombs compute the resulting length on NULL input.

Dmitry Timoshkov dmitry at baikal.ru
Wed Sep 11 22:37:40 CDT 2019


For compatibility with RtlUnicodeToUTF8N.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 libs/port/utf8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libs/port/utf8.c b/libs/port/utf8.c
index f47561e4bf..6dddd815c9 100644
--- a/libs/port/utf8.c
+++ b/libs/port/utf8.c
@@ -99,7 +99,7 @@ int wine_utf8_wcstombs( int flags, const WCHAR *src, int srclen, char *dst, int
 {
     int len;
 
-    if (!dstlen) return get_length_wcs_utf8( flags, src, srclen );
+    if (!dst) return get_length_wcs_utf8( flags, src, srclen );
 
     for (len = dstlen; srclen; srclen--, src++)
     {
-- 
2.20.1




More information about the wine-devel mailing list