projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
577820a
)
gpiomon: check if offset is not negative
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Tue, 17 Jan 2017 16:21:28 +0000
(17:21 +0100)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Tue, 17 Jan 2017 16:21:28 +0000
(17:21 +0100)
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/tools/gpiomon.c
patch
|
blob
|
history
diff --git
a/src/tools/gpiomon.c
b/src/tools/gpiomon.c
index c8157cc02d538c98e481aada9a3dcf74503585c2..10e7e355181b411ce8de2a604691b553e3487227 100644
(file)
--- a/
src/tools/gpiomon.c
+++ b/
src/tools/gpiomon.c
@@
-15,6
+15,7
@@
#include <string.h>
#include <getopt.h>
#include <signal.h>
+#include <limits.h>
static const struct option longopts[] = {
{ "help", no_argument, NULL, 'h' },
@@
-158,7
+159,7
@@
int main(int argc, char **argv)
device = argv[0];
offset = strtoul(argv[1], &end, 10);
- if (*end != '\0')
+ if (*end != '\0'
|| offset > INT_MAX
)
die("invalid GPIO offset: %s", argv[1]);
timeout.tv_sec = 0;