diff options
author | Calvin <calvin@bastille> | 2014-02-23 15:41:35 -0500 |
---|---|---|
committer | Calvin <calvin@bastille> | 2014-02-23 15:41:35 -0500 |
commit | dc0222175d99a7b156c6047e6988e8805bb2e14d (patch) | |
tree | bcb6ac30cd2f732dd22832f203eecbc437a23fc1 /hotkey.c | |
parent | d500577952549c68ac778e7cc58328c616ee99f9 (diff) |
update readme and fix warning
Diffstat (limited to 'hotkey.c')
-rw-r--r-- | hotkey.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -127,13 +127,13 @@ struct Key **load_hotkeys(FILE *fh, size_t *key_len) { keys[*key_len] = key; *key_len = *key_len + 1; - realloc(keys, sizeof(struct Key *) * realloc_size); - realloc_size++; - + keys = realloc(keys, sizeof(struct Key *) * realloc_size); if(keys == NULL) { fprintf(stderr, "could not realloc keys\n"); exit(EXIT_FAILURE); } + + realloc_size++; } line_nb++; @@ -141,6 +141,7 @@ struct Key **load_hotkeys(FILE *fh, size_t *key_len) { if(*key_len != 0) return keys; + return NULL; } @@ -165,7 +166,6 @@ void wait_for_input(Display* dpy, Window root, struct Key **hotkeys, size_t len) } } } - } int main(int argc, char **argv) { |