X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=roguelike.c;h=34f3c855da6c9d2927bfad84e73ff11fe207f4e7;hb=4278fa073915777094328bc6575cdcc1f849f9f1;hp=ee5dbe48be76fa54e3e9f7cafd2993a0c13404d6;hpb=ddf0e5d24690e9985c51d9960e035ee21286dd49;p=plomrogue diff --git a/roguelike.c b/roguelike.c index ee5dbe4..34f3c85 100644 --- a/roguelike.c +++ b/roguelike.c @@ -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++;