home · contact · privacy
Corrected broken if.
[plomrogue] / roguelike.c
index ee5dbe48be76fa54e3e9f7cafd2993a0c13404d6..34f3c855da6c9d2927bfad84e73ff11fe207f4e7 100644 (file)
@@ -262,7 +262,7 @@ void init_keybindings(struct World * world) {
   c = getc(file);
   while (EOF != c) {
     if ('\n' == c) {
-      keybindings[keycount].name = calloc(commcount, sizeof(char));
+      keybindings[keycount].name = calloc(commcount + 1, sizeof(char));
       memcpy(keybindings[keycount].name, command, commcount);
       keybindings[keycount].key = key;
       keycount++;