From e884290d292bf7ef9f013a3e44cda1aa0bcf02d5 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 8 Sep 2019 15:23:32 +0200 Subject: [PATCH] [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;