Commit 293c704cbedd95779351a7295683159e93e12de7

Ran Benita 2018-10-01T10:24:45

Merge pull request #69 from alanc/master Fix off-by-one error in index check in xkb_file_type_to_string

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/xkbcomp/ast-build.c b/src/xkbcomp/ast-build.c
index 2de9e61..365ff51 100644
--- a/src/xkbcomp/ast-build.c
+++ b/src/xkbcomp/ast-build.c
@@ -729,7 +729,7 @@ static const char *xkb_file_type_strings[_FILE_TYPE_NUM_ENTRIES] = {
 const char *
 xkb_file_type_to_string(enum xkb_file_type type)
 {
-    if (type > _FILE_TYPE_NUM_ENTRIES)
+    if (type >= _FILE_TYPE_NUM_ENTRIES)
         return "unknown";
     return xkb_file_type_strings[type];
 }