mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
udev-builtin-keyboard: Fix large scan codes on 32 bit architectures
Use strtoul(), as scan codes are always positive. On 32 bit architectures strtol gives wrong results: strtol("fffffff0", &endptr, 16) returns 2147483647 instead of 4294967280. https://launchpad.net/bugs/1247676
This commit is contained in:
parent
e9718c12a4
commit
b151ca9933
@ -88,7 +88,7 @@ static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], boo
|
||||
continue;
|
||||
|
||||
/* KEYBOARD_KEY_<hex scan code>=<key identifier string> */
|
||||
scancode = strtol(key + 13, &endptr, 16);
|
||||
scancode = strtoul(key + 13, &endptr, 16);
|
||||
if (endptr[0] != '\0') {
|
||||
log_error("Error, unable to parse scan code from '%s'\n", key);
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user