Commit c50fbab4 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

user: GetClipboardFormatNameA fix.

In the W->A translation make sure we have characters to translate before doing the WideCharToMultiByte with -1.
parent 2302d2b4
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment