Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
| -rw-r--r-- | mapScore.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -20,7 +20,7 @@ void makeMap(FILE *f) { map[c][1] = y; map[c][2] = 1; c = toupper(c); - if (map[toupper(c)][2] == 0) goto explicit_label; + if (c < 256 && map[c][2] == 0) goto explicit_label; break; } } @@ -33,8 +33,8 @@ int scoreWord(char *word, int (*fun)(int*,int*)) { for (c++;*c;c++) { if (*c == '\n') break; // pass over ignore unset chars. - if(map[(unsigned)*c][3] == 0) continue; - score += (*fun)(map[(unsigned)*p],map[(unsigned)*c]); + if(map[(unsigned char)*c][3] == 0) continue; + score += (*fun)(map[(unsigned char)*p],map[(unsigned char)*c]); p=c; } return score; |