user: GetClipboardFormatNameA fix.
In the W->A translation make sure we have characters to translate before doing the WideCharToMultiByte with -1.
This commit is contained in:
parent
2302d2b470
commit
c50fbab47f
|
@ -271,7 +271,7 @@ INT WINAPI GetClipboardFormatNameA(UINT wFormat, LPSTR retStr, INT maxlen)
|
||||||
|
|
||||||
ret = GetClipboardFormatNameW( wFormat, p, 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;
|
retStr[maxlen-1] = 0;
|
||||||
HeapFree( GetProcessHeap(), 0, p );
|
HeapFree( GetProcessHeap(), 0, p );
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue