From c14d4a9e9d07bfa1a8493d941f101f85e9ca0fb0 Mon Sep 17 00:00:00 2001 From: Giuliano Belinassi Date: Wed, 26 Jun 2024 22:26:07 -0300 Subject: [PATCH] Fix return value of `strupr` Pointer arithmetic changes the address hold by `str`, so we must save it before returning. Signed-off-by: Giuliano Belinassi --- common/wwstd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/wwstd.h b/common/wwstd.h index 03c7d170..5e41f066 100644 --- a/common/wwstd.h +++ b/common/wwstd.h @@ -262,11 +262,12 @@ inline static void _splitpath(const char* path, char* drive, char* dir, char* fn inline static char* strupr(char* str) { + char* ret = str; while (*str != '\0') { *str = toupper(*str); ++str; } - return str; + return ret; } inline static void strrev(char* str)