From ca20ff4f4d0ac63856e538f9f4cef97197bf6465 Mon Sep 17 00:00:00 2001 From: c Date: Sun, 28 Jan 2024 21:43:37 -0500 Subject: Fixed buffer-overflow. --- src/tree.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/tree.c') diff --git a/src/tree.c b/src/tree.c index 62c8218..8398598 100644 --- a/src/tree.c +++ b/src/tree.c @@ -130,13 +130,20 @@ int tree_cmp(tree_t* tree_0, tree_t* tree_1) { return (strcmp(tree_0->data.call.target, tree_1->data.call.target) == 0) && tree_cmp(tree_0->data.call.arg, tree_1->data.call.arg); break; + default: + log_war("Unknown tree type."); } + + return 0; } /* Every time I think there's a problem with the parser, it turns out it's - just this stupid tree print function. + just this stupid tree print function. Now it works. Never touching it + again. Ever. */ +#pragma GCC diagnostic ignored "-Wunused-value" +#pragma GCC diagnostic ignored "-Wmisleading-indentation" void tree_print(tree_t* tree, int nest) { char*sp;int nc, i;char*c;char*bc;for(i =0,sp=ecalloc(nest+1,sizeof(char)),sp[ @@ -226,3 +233,5 @@ void tree_print(tree_t* tree, int nest) { free(bc); return; } +#pragma GCC diagnostic warning "-Wunused-value" +#pragma GCC diagnostic warning "-Wmisleading-indentation" -- cgit v1.2.3