Commits

Anonymous committed a5345a8

keymap: Fix parsing of hex scan codes in tables

Commit b1f87c76b1 changed sscanf from %i to %u, as scan codes are unsigned
numbers which can be > 0x7FFFFFFF. However, sscanf doesn't accept hexadecimal
numbers for %u. It works fine with %i, so revert this back.

Comments (0)

Files changed (1)

src/keymap/keymap.c

                 if (*p == '#' || *p == '\n')
                         continue;
 
-                if (sscanf(p, "%u %i", &scancode, &new_keycode) != 2) {
+                if (sscanf(p, "%i %i", &scancode, &new_keycode) != 2) {
                         char t[105] = "KEY_UNKNOWN";
                         const struct key *k;
 
-                        if (sscanf(p, "%u %100s", &scancode, t+4) != 2) {
+                        if (sscanf(p, "%i %100s", &scancode, t+4) != 2) {
                                 fprintf(stderr, "WARNING: Parse failure at line %i, ignoring.\n", line);
                                 r = -1;
                                 continue;