diff --git a/src/client/input/sdl2.c b/src/client/input/sdl2.c index decb8001..48239f54 100644 --- a/src/client/input/sdl2.c +++ b/src/client/input/sdl2.c @@ -2331,8 +2331,11 @@ IN_GetClipboardText(char *out, size_t n) SDL_free(s); } +/* Copy string s to the clipboard. + Returns 0 on success, 1 otherwise. +*/ int IN_SetClipboardText(const char *s) { - return SDL_SetClipboardText(s); + return SDL_SetClipboardText(s) != 0; } diff --git a/src/client/input/sdl3.c b/src/client/input/sdl3.c index 52b97535..2bee5218 100644 --- a/src/client/input/sdl3.c +++ b/src/client/input/sdl3.c @@ -2437,8 +2437,13 @@ IN_GetClipboardText(char *out, size_t n) SDL_free(s); } +/* Copy string s to the clipboard. + Returns 0 on success, 1 otherwise. +*/ int IN_SetClipboardText(const char *s) { - return SDL_SetClipboardText(s); + bool res = SDL_SetClipboardText(s); + + return !res; } diff --git a/src/common/filesystem.c b/src/common/filesystem.c index ee555dc3..a578fb00 100644 --- a/src/common/filesystem.c +++ b/src/common/filesystem.c @@ -2022,6 +2022,7 @@ FS_Dir_f(void) char **dirnames; /* File list. */ char findname[1024]; /* File search path and pattern. */ char *path = NULL; /* Search path. */ + char *lastsep; char wildcard[1024] = "*.*"; /* File pattern. */ int i; /* Loop counter. */ int ndirs; /* Number of files in list. */ @@ -2043,9 +2044,10 @@ FS_Dir_f(void) { for (i = 0; i < ndirs - 1; i++) { - if (strrchr(dirnames[i], '/')) + lastsep = strrchr(dirnames[i], '/'); + if (lastsep) { - Com_Printf("%s\n", strrchr(dirnames[i], '/') + 1); + Com_Printf("%s\n", lastsep + 1); } else {