mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
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.
This commit is contained in:
parent
6e303b233b
commit
3bb9434b69
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user