From: Christian Heller Date: Sat, 31 Aug 2013 03:34:46 +0000 (+0200) Subject: Fixed off-by-one error encountered while changing default key for 'reload_wins' command. X-Git-Tag: tce~986 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/tasks?a=commitdiff_plain;h=9a9f9b13bef8394e1b25dc4d67ff72164dd28cce;p=plomrogue Fixed off-by-one error encountered while changing default key for 'reload_wins' command. --- diff --git a/README b/README index 6ad1207..f21799c 100644 --- a/README +++ b/README @@ -45,7 +45,7 @@ Y shift window backwards _ shrink window horizontally + grow window vertically - shrink window vertically -Z reload window configuration +r reload window configuration w scroll map up x scroll map down diff --git a/config/keybindings b/config/keybindings index 009a8b7..257ff5e 100644 --- a/config/keybindings +++ b/config/keybindings @@ -17,6 +17,7 @@ 95 shri_h 43 grow_v 45 shri_v +114 reload_wins 119 map_u 120 map_d 97 map_l @@ -27,4 +28,3 @@ 65 player_l 68 player_r 83 wait -90 reload_wins diff --git a/src/keybindings.c b/src/keybindings.c index 3ce0e44..121304b 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -24,7 +24,7 @@ extern void init_keybindings(struct World * world) char * command = malloc(linemax); uint16_t commcount = 0; char * cmdptr; - while (fgets(command, linemax, file)) + while (fgets(command, linemax + 1, file)) { keybindings[commcount].key = atoi(command); cmdptr = strchr(command, ' ') + 1;