Skip to content

Commit

Permalink
Fix return value of strupr
Browse files Browse the repository at this point in the history
Pointer arithmetic changes the address hold by `str`, so we must save
it before returning.

Signed-off-by: Giuliano Belinassi <[email protected]>
  • Loading branch information
giulianobelinassi authored and OmniBlade committed Jun 27, 2024
1 parent 6f1bf9a commit d06fa00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/wwstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d06fa00

Please sign in to comment.