summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-02-26 15:53:47 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-02-26 15:53:47 +0000
commite67c250c80d1da4e8210c62cf473deeb2ba4e152 (patch)
tree58606dad850bfdd2737152bdb88bac356442e354 /input
parent15b471676729c330796ebabe9481a028a76b1112 (diff)
Fake input: fixed get_class
Diffstat (limited to 'input')
-rw-r--r--input/device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/input/device.c b/input/device.c
index 674a1c53..7cd595d0 100644
--- a/input/device.c
+++ b/input/device.c
@@ -1291,11 +1291,12 @@ static int get_class(bdaddr_t *src, bdaddr_t *dst, uint32_t *cls)
if (!str)
return -ENOENT;
- *cls = strtol(str, NULL, 16);
+ if (sscanf(str, "%x", cls) != 1) {
+ free(str);
+ return -ENOENT;
+ }
free(str);
- if ((*cls == LONG_MIN) || (*cls == LONG_MAX))
- return -ERANGE;
return 0;
}