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
1 changed files with 1 additions and 1 deletions

View File

@ -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];
}