home · contact · privacy
Fixed off-by-one error encountered while changing default key for 'reload_wins' command.
[plomrogue] / src / keybindings.c
index 3ce0e440b2d319af9ff0b81d1040bc468518c10f..121304bdadd9ed2d773adf6eed374f4c8a034bd4 100644 (file)
@@ -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;