Handle negative errcodes

This commit is contained in:
x3 2022-01-08 20:36:22 +01:00
parent b9b4c2514d
commit bb4da9ea31
Signed by: x3
GPG Key ID: 7E9961E8AD0E240E

View File

@ -6,7 +6,7 @@ static const char *error_string[] = {
const char *error_to_string(enum error err) const char *error_to_string(enum error err)
{ {
if (err >= _ERR_COUNT) if (err >= _ERR_COUNT || err < 0)
return "ERR_UNKNOWN"; return "ERR_UNKNOWN";
return error_string[err]; return error_string[err];
} }