mirror of
https://github.com/fancycode/MemoryModule
synced 2026-06-06 15:44:28 +00:00
Fix string termination for UNICODE.
This commit is contained in:
+3
-1
@@ -1162,7 +1162,9 @@ MemoryLoadStringExW(HMEMORYMODULE module, UINT id, LPWSTR buffer, int maxsize, W
|
|||||||
|
|
||||||
size = data->Length;
|
size = data->Length;
|
||||||
if (size >= maxsize) {
|
if (size >= maxsize) {
|
||||||
size = maxsize - 1;
|
size = maxsize;
|
||||||
|
} else {
|
||||||
|
buffer[size] = 0;
|
||||||
}
|
}
|
||||||
wcsncpy(buffer, data->NameString, size);
|
wcsncpy(buffer, data->NameString, size);
|
||||||
return size;
|
return size;
|
||||||
|
|||||||
Reference in New Issue
Block a user