Fix string termination for UNICODE.

This commit is contained in:
Joachim Bauch
2016-09-21 01:59:27 +02:00
parent 13e979e0b7
commit d718478cfc
+3 -1
View File
@@ -1162,7 +1162,9 @@ MemoryLoadStringExW(HMEMORYMODULE module, UINT id, LPWSTR buffer, int maxsize, W
size = data->Length;
if (size >= maxsize) {
size = maxsize - 1;
size = maxsize;
} else {
buffer[size] = 0;
}
wcsncpy(buffer, data->NameString, size);
return size;