summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2013-11-04 07:25:45 +0100
committerMartin Pitt <martinpitt@gnome.org>2013-11-04 07:25:45 +0100
commitb151ca99332f08a6b9909baf94bc5667a589538b (patch)
tree0ebd640d2e2bf91b30d852edd0e7e9e3c1901c08 /src/udev
parente9718c12a4ca7f88324b636b36a4375aae64a1cc (diff)
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
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-builtin-keyboard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c
index ddd853594e..8f457ab4a2 100644
--- a/src/udev/udev-builtin-keyboard.c
+++ b/src/udev/udev-builtin-keyboard.c
@@ -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;