From 4c654cd6218ed219d555518262a3ee9059a5620b Mon Sep 17 00:00:00 2001 From: Vftdan Date: Sun, 18 Aug 2024 20:23:57 +0200 Subject: [PATCH] Check that there are no positional arguments --- main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index d124e82..a6d5383 100644 --- a/main.c +++ b/main.c @@ -84,6 +84,10 @@ main(int argc, char ** argv) return 1; } } + if (optind < argc) { + fprintf(stderr, "Unexpected positional argument at position %d: %s\n", optind, argv[optind]); + return 1; + } ProcessingState state = (ProcessingState) { .wait_delay = NULL,