summaryrefslogtreecommitdiffstats
path: root/apps/lib/opt.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--apps/lib/opt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/lib/opt.c b/apps/lib/opt.c
index 3925ec96c3..7967fa7956 100644
--- a/apps/lib/opt.c
+++ b/apps/lib/opt.c
@@ -1036,14 +1036,14 @@ int opt_check_rest_arg(const char *expected)
return 1;
opt_printf_stderr("%s: Missing argument: %s\n", prog, expected);
return 0;
- } else if (expected != NULL) {
- return 1;
}
+ if (expected != NULL)
+ return 1;
if (opt_unknown() == NULL)
opt_printf_stderr("%s: Extra option: \"%s\"\n", prog, opt);
else
opt_printf_stderr("%s: Extra (unknown) options: \"%s\" \"%s\"\n",
- prog, opt_unknown(), opt != NULL ? opt : "");
+ prog, opt_unknown(), opt);
return 0;
}