X-Git-Url: https://plomlompom.com/repos//%22https:/validator.w3.org/check?a=blobdiff_plain;f=src%2Fkeybindings.c;h=8b01958c940d5079f4d5157b6034a92f918a056e;hb=0568c1c0f6735509f2a1afea31ecb5dc28f26bf4;hp=121304bdadd9ed2d773adf6eed374f4c8a034bd4;hpb=2f0b15e05b0df7e10a2d0bb04ce4648455d980a8;p=plomrogue diff --git a/src/keybindings.c b/src/keybindings.c index 121304b..8b01958 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -21,7 +21,7 @@ extern void init_keybindings(struct World * world) char * err = "textfile_sizes() in init_keybindings() returns error."; exit_err(textfile_sizes(file, &linemax, &lines), world, err); struct KeyBinding * keybindings = malloc(lines * sizeof(struct KeyBinding)); - char * command = malloc(linemax); + char * command = malloc(linemax + 1); uint16_t commcount = 0; char * cmdptr; while (fgets(command, linemax + 1, file))