summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-10-19 08:01:47 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-10-19 08:01:47 +0200
commit3bb9434b69b8562117b8ec34b4498aa208907316 (patch)
treeebbf3597247c3c6d69e9ff6474abfbba24fc071f
parent6e303b233beae8d189d5e4f8c58ad3fa534a087a (diff)
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.
-rw-r--r--src/udev/keymap/keymap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/keymap/keymap.c b/src/udev/keymap/keymap.c
index 0db33b9a86..a6f97ddcef 100644
--- a/src/udev/keymap/keymap.c
+++ b/src/udev/keymap/keymap.c
@@ -204,11 +204,11 @@ static int merge_table(int fd, FILE *f) {
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;