summaryrefslogtreecommitdiffstats
path: root/games/joy2key/button_list_segfault.patch
blob: 2a6e95d197bf165379a2d6afedc3f466d66aa0d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Author: Jonathan Niehof <jtniehof@gmail.com>
Subject: Fix a segfault when parsing options to -buttons
Last-Update: 2009-12-06
Forwarded: yes
Bug: https://sourceforge.net/tracker/?func=detail&aid=2909756&group_id=227783&atid=1072387

joy2key segfaults when reading the list of keystrokes to associate with
buttons. This is a regression from 1.6.1 and this patch simply reverts
the offending line to that earlier version. I have verified that, with
the patch applied, all buttons on the joystick are usable and all buttons
listed on the command line are processed appropriately.

Index: joy2key-1.6.3/joy2key.c
===================================================================
--- joy2key-1.6.3.orig/joy2key.c	2009-12-06 15:38:56.000000000 -0500
+++ joy2key-1.6.3/joy2key.c	2009-12-06 15:50:48.000000000 -0500
@@ -576,7 +576,7 @@
 				exit(1);
 			}
 			button_act_counter=0;
-			while((i+1)<=argc && (argv[i+1][0]!='-' || 
+			while((i+1)<argc && (argv[i+1][0]!='-' || 
 								 (argv[i+1][0]=='-' && !argv[i+1][1])))
 			{
 				button_actions[button_act_counter]=argtokey(argv[++i]);