From d528e634778337edf1c615aeaa3fef47b7510d2b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 9 Feb 2020 10:20:48 +0100 Subject: [PATCH] [CRT] Only write to the output buffer when necessary in _strlwr. CORE-16667 Like e884290d292, this is also a hack and is missing locale awareness. --- sdk/lib/crt/string/strlwr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sdk/lib/crt/string/strlwr.c b/sdk/lib/crt/string/strlwr.c index 5966a5bf3aa..53d06dc9d96 100644 --- a/sdk/lib/crt/string/strlwr.c +++ b/sdk/lib/crt/string/strlwr.c @@ -7,9 +7,13 @@ char * CDECL _strlwr(char *x) { char *y=x; + char ch, lower; while (*y) { - *y=tolower(*y); + ch = *y; + lower = tolower(ch); + if (ch != lower) + *y = lower; y++; } return x;