From 9a9f9b13bef8394e1b25dc4d67ff72164dd28cce Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sat, 31 Aug 2013 05:34:46 +0200
Subject: [PATCH] Fixed off-by-one error encountered while changing default key
 for 'reload_wins' command.

---
 README             | 2 +-
 config/keybindings | 2 +-
 src/keybindings.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

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;
-- 
2.30.2