From a8f4122146ea8774fb8cb7aac7bc48c37299d6d4 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 28 Sep 2020 13:48:53 +0200 Subject: [PATCH] jitters: return non-zero on parsing error --- src/jitters.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/jitters.c b/src/jitters.c index be817e9..278f70e 100644 --- a/src/jitters.c +++ b/src/jitters.c @@ -6,11 +6,14 @@ int main(void) { - struct ast_node *res; + struct ast_node *ast = NULL; + int ret = 0; yydebug = getenv("PARSE") != NULL; - if (yyparse(&res) == 0) { - destroy_ast(res); + if ((ret = yyparse(&ast)) == 0) { + /* Nothing */ } - return 0; + destroy_ast(ast); + + return ret; }