Skip to content

Commit d718478

Browse files
committed
Fix string termination for UNICODE.
1 parent 13e979e commit d718478

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MemoryModule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,9 @@ MemoryLoadStringExW(HMEMORYMODULE module, UINT id, LPWSTR buffer, int maxsize, W
11621162

11631163
size = data->Length;
11641164
if (size >= maxsize) {
1165-
size = maxsize - 1;
1165+
size = maxsize;
1166+
} else {
1167+
buffer[size] = 0;
11661168
}
11671169
wcsncpy(buffer, data->NameString, size);
11681170
return size;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy