clipboard fix

Aric Stewart aric at codeweavers.com
Tue Dec 13 11:16:06 CST 2005


in the W->A translation make sure we have characters to translate before 
doing the WideCharToMultiByte with -1.

-------------- next part --------------
Index: dlls/user/clipboard.c
===================================================================
RCS file: /home/wine/wine/dlls/user/clipboard.c,v
retrieving revision 1.3
diff -u -r1.3 clipboard.c
--- dlls/user/clipboard.c	18 Jul 2005 15:14:56 -0000	1.3
+++ dlls/user/clipboard.c	13 Dec 2005 17:10:31 -0000
@@ -271,7 +271,7 @@
 
     ret = GetClipboardFormatNameW( wFormat, p, maxlen );
 
-    if (maxlen > 0 && !WideCharToMultiByte( CP_ACP, 0, p, -1, retStr, maxlen, 0, 0))
+    if (ret && maxlen > 0 && !WideCharToMultiByte( CP_ACP, 0, p, -1, retStr, maxlen, 0, 0))
         retStr[maxlen-1] = 0;
     HeapFree( GetProcessHeap(), 0, p );
     return ret;


More information about the wine-patches mailing list