From 5dd30eea54d5b1ef25e517505c5a47ff1a37c424 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Sat, 21 Mar 2020 08:39:49 +0100 Subject: handle invalid operators (although not possible because of parsing, this fixes a clang warning) --- src/template.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/template.c b/src/template.c index cf021c1..6949068 100644 --- a/src/template.c +++ b/src/template.c @@ -425,11 +425,15 @@ struct unja_object *eval_infix_expression(struct unja_object *left, char *op, st case '!': if (op[1] == '=') { result = object_to_int(left) != object_to_int(right); + } else { + errx(EXIT_FAILURE, "invalid int operator: %s", op); } break; case '=': if (op[1] == '=') { result = object_to_int(left) == object_to_int(right); + } else { + errx(EXIT_FAILURE, "invalid int operator: %s", op); } break; } -- cgit v1.2.3