From: Bartosz Golaszewski Date: Wed, 14 Jun 2017 10:53:19 +0000 (+0200) Subject: gpiomon: don't ignore superfluous arguments X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=01a8307bb735f27770bdcff952eab1bb6c95cb1d;p=qemu-gpiodev%2Flibgpiod.git gpiomon: don't ignore superfluous arguments We don't currently support watching more than one line at a time. Bail out if the user gives us more than two non-option arguments. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/tools/gpiomon.c b/src/tools/gpiomon.c index afc511b..6b984b9 100644 --- a/src/tools/gpiomon.c +++ b/src/tools/gpiomon.c @@ -158,6 +158,9 @@ int main(int argc, char **argv) if (argc < 2) die("GPIO line offset must be specified"); + if (argc > 2) + die("watching more than one GPIO line unsupported"); + device = argv[0]; offset = strtoul(argv[1], &end, 10); if (*end != '\0' || offset > INT_MAX)