From 80ff833dd8ad011b579bff26ac654819e6735bce Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 25 Jul 2015 18:22:07 -0700 Subject: Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows). --- tern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tern.c') diff --git a/tern.c b/tern.c index e4f80f8..dda6497 100644 --- a/tern.c +++ b/tern.c @@ -8,6 +8,7 @@ #include #include #include +#include "util.h" tern_node * tern_insert(tern_node * head, char * key, tern_val value) { @@ -190,8 +191,7 @@ void tern_foreach_int(tern_node *head, iter_fun fun, void *data, char *keybuf, i } if (head->el) { if (pos == MAX_ITER_KEY) { - fputs("exceeded maximum key size", stderr); - exit(1); + fatal_error("tern_foreach_int: exceeded maximum key size"); } keybuf[pos] = head->el; tern_foreach_int(head->straight.next, fun, data, keybuf, pos+1); -- cgit v1.2.3