diff options
author | koekeishiya <aasvi93@hotmail.com> | 2017-08-24 10:45:33 +0200 |
---|---|---|
committer | koekeishiya <aasvi93@hotmail.com> | 2017-08-24 10:45:33 +0200 |
commit | 498e08c26b58a5c454a8004920923febd4c5061b (patch) | |
tree | 3d11c16d280612ff42f080a63adfdddae85d2f9e | |
parent | 2d0f8f425c11b2a5e5077a3c273293da5b61d45b (diff) | |
download | skhd-498e08c26b58a5c454a8004920923febd4c5061b.tar.gz skhd-498e08c26b58a5c454a8004920923febd4c5061b.zip |
#2 don't segfault upon parse-error
-rw-r--r-- | src/parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parse.c b/src/parse.c index b59e4cd..d80034c 100644 --- a/src/parse.c +++ b/src/parse.c @@ -192,11 +192,11 @@ void parse_config(struct parser *parser, struct table *hotkey_map) (parser_check(parser, Token_Key_Hex)) || (parser_check(parser, Token_Key))) { hotkey = parse_hotkey(parser); - table_add(hotkey_map, hotkey, hotkey); if(parser->error) { free_hotkeys(hotkey_map); return; } + table_add(hotkey_map, hotkey, hotkey); } else { fprintf(stderr, "(#%d:%d) expected token 'Token_Modifier', 'Token_Key_Hex' or 'Token_Key', but got '%.*s'\n", parser->current_token.line, parser->current_token.cursor, |