From c50fbab47f99a5787e29892fce6686c5eb92939c Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 14 Dec 2005 10:49:54 +0100 Subject: [PATCH] user: GetClipboardFormatNameA fix. In the W->A translation make sure we have characters to translate before doing the WideCharToMultiByte with -1. --- dlls/user/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user/clipboard.c b/dlls/user/clipboard.c index 5a51f01faf2..2e54f76ff15 100644 --- a/dlls/user/clipboard.c +++ b/dlls/user/clipboard.c @@ -271,7 +271,7 @@ INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen) 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; -- 2.11.4.GIT