https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e884290d292bf7ef9f013…
commit e884290d292bf7ef9f013a3e44cda1aa0bcf02d5
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Sep 8 15:23:32 2019 +0200
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Feb 8 13:04:12 2020 +0100
[CRT] Only write to the output buffer when necessary in _strupr. CORE-16667
Fixes crash in msvcrt_winetest:string.
This is a hack and is supposed to be specific to the C locale.
---
sdk/lib/crt/string/strupr.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sdk/lib/crt/string/strupr.c b/sdk/lib/crt/string/strupr.c
index 126f8f25c62..25d84bbf78c 100644
--- a/sdk/lib/crt/string/strupr.c
+++ b/sdk/lib/crt/string/strupr.c
@@ -16,9 +16,13 @@
char * CDECL _strupr(char *x)
{
char *y=x;
+ char ch, upper;
while (*y) {
- *y=toupper(*y);
+ ch = *y;
+ upper = toupper(ch);
+ if (ch != upper)
+ *y = upper;
y++;
}
return x;