Commit ed7aca01 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

kernelbase: Put 0 to output string even for 1 char buffer in LoadStringW().

parent d93e2899
......@@ -1253,19 +1253,8 @@ INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, L
}
i = min(buflen - 1, *p);
if (i > 0)
{
memcpy(buffer, p + 1, i * sizeof (WCHAR));
buffer[i] = 0;
}
else
{
if (buflen > 1)
{
buffer[0] = 0;
return 0;
}
}
memcpy(buffer, p + 1, i * sizeof(WCHAR));
buffer[i] = 0;
TRACE("returning %s\n", debugstr_w(buffer));
return i;
......
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