From 5bba5d9bc9e2b223bf596b8af41d0a5343336074 Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 13 Mar 2023 21:47:28 +0100 Subject: [PATCH] oops forgot about that --- libs/argv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/argv.c b/libs/argv.c index 1381a1f..a289755 100644 --- a/libs/argv.c +++ b/libs/argv.c @@ -137,7 +137,12 @@ readargs(int argc, char *argv[]) } else if (!strcmp(argv[i], "-nip")) { /* don't indent to prompt width */ indentitems = 0; } else if (i + 1 == argc) { - fprintf(stderr, "spmenu: The '%s' option requires an argument.\n", argv[i-1]); + int arg = i; + + if (arg != 1) + fprintf(stderr, "spmenu: The '%s' option requires an argument.\n", argv[i-1]); + else + fprintf(stderr, "spmenu: Invalid argument: '%s'\n", argv[i]); /* these options take one argument */ } else if (!strcmp(argv[i], "-g")) { /* number of columns in grid */