Handle negative errcodes
This commit is contained in:
parent
b9b4c2514d
commit
bb4da9ea31
@ -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];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user