Fix signed vs. unsigned confusion in name sanitisation Don't try to divide through a signed char when indexing an array, lest ye try to index off the start of it. Signed-off-by: Daniel Stone <daniels@collabora.com>
diff --git a/src/keymap-priv.c b/src/keymap-priv.c
index 08945ca..fffb2fd 100644
--- a/src/keymap-priv.c
+++ b/src/keymap-priv.c
@@ -118,7 +118,8 @@ XkbEscapeMapName(char *name)
return;
while (*name) {
- if (!(legal[*name / 8] & (1 << (*name % 8))))
+ unsigned char c = *name;
+ if (!(legal[c / 8] & (1 << (c % 8))))
*name = '_';
name++;
}