diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-02-26 15:53:47 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-02-26 15:53:47 +0000 |
commit | e67c250c80d1da4e8210c62cf473deeb2ba4e152 (patch) | |
tree | 58606dad850bfdd2737152bdb88bac356442e354 /input | |
parent | 15b471676729c330796ebabe9481a028a76b1112 (diff) |
Fake input: fixed get_class
Diffstat (limited to 'input')
-rw-r--r-- | input/device.c | 7 |
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; } |