From bb4da9ea319fda75e1ebd1d7a0c13adbd20178db Mon Sep 17 00:00:00 2001 From: x3 Date: Sat, 8 Jan 2022 20:36:22 +0100 Subject: [PATCH] Handle negative errcodes --- src/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.c b/src/error.c index e0e61e7..cb22a89 100644 --- a/src/error.c +++ b/src/error.c @@ -6,7 +6,7 @@ static const char *error_string[] = { const char *error_to_string(enum error err) { - if (err >= _ERR_COUNT) + if (err >= _ERR_COUNT || err < 0) return "ERR_UNKNOWN"; return error_string[err]; }