From 01a8307bb735f27770bdcff952eab1bb6c95cb1d Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 14 Jun 2017 12:53:19 +0200 Subject: [PATCH] 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 --- src/tools/gpiomon.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.30.2