util: cast smaller type to large type

This commit is contained in:
Yu Watanabe
2018-12-02 05:58:18 +01:00
parent da96ad5ae2
commit cedfe0b02b
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ const char *errno_to_name(int id) {
if (id < 0)
id = -id;
if (id >= (int) ELEMENTSOF(errno_names))
if ((size_t) id >= ELEMENTSOF(errno_names))
return NULL;
return errno_names[id];