diff options
Diffstat (limited to 'games/rejoystick/rejoystick.patch')
-rw-r--r-- | games/rejoystick/rejoystick.patch | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/games/rejoystick/rejoystick.patch b/games/rejoystick/rejoystick.patch index a163936aeb..f4e955c767 100644 --- a/games/rejoystick/rejoystick.patch +++ b/games/rejoystick/rejoystick.patch @@ -1,6 +1,7 @@ ---- rejoystick-0.8.1/src/main.c.orig 2014-12-20 06:55:37.951753670 +0700 -+++ rejoystick-0.8.1/src/main.c 2014-12-20 06:56:23.666092712 +0700 -@@ -137,13 +137,9 @@ +diff -Naur rejoystick-0.8.1/src/main.c rejoystick-0.8.1.patched/src/main.c +--- rejoystick-0.8.1/src/main.c 2008-03-23 10:38:22.000000000 -0400 ++++ rejoystick-0.8.1.patched/src/main.c 2022-03-15 21:28:38.753577677 -0400 +@@ -137,12 +137,11 @@ pthread_t sdl_thread; @@ -10,10 +11,11 @@ - home = (char*)getenv("HOME"); - keyfile = KEYFILE; - filename = strcat(home, keyfile); -- -+ const char * home = getenv("HOME"); -+ filename = malloc(strlen(home) + strlen(KEYFILE) + 1); -+ sprintf(filename, "%s%s", home, KEYFILE); - global_argv = argv; ++ const char * home = getenv("HOME"); ++ if(!home) error("HOME not set in environment"); ++ filename = malloc(strlen(home) + strlen(KEYFILE) + 1); ++ if(!filename) error("Out of memory"); ++ sprintf(filename, "%s%s", home, KEYFILE); + global_argv = argv; |