aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fbset.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-05-09 03:57:27 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-05-09 03:57:27 +0200
commit12bc152b31420c3e3d441c87a995fe7b65dd23fe (patch)
tree28ce3d83a81bcc0e7008472516309540ab0b409b /util-linux/fbset.c
parented607a87e042bd0470c21244db814d599e2bce4f (diff)
downloadbusybox-w32-12bc152b31420c3e3d441c87a995fe7b65dd23fe.tar.gz
busybox-w32-12bc152b31420c3e3d441c87a995fe7b65dd23fe.tar.bz2
busybox-w32-12bc152b31420c3e3d441c87a995fe7b65dd23fe.zip
fbset: abort on unknown options. closes 3121
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/fbset.c')
-rw-r--r--util-linux/fbset.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 75d41b882..3be342481 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -402,7 +402,14 @@ int fbset_main(int argc, char **argv)
402 argv++; 402 argv++;
403 argc--; 403 argc--;
404 for (; argc > 0 && (thisarg = *argv) != NULL; argc--, argv++) { 404 for (; argc > 0 && (thisarg = *argv) != NULL; argc--, argv++) {
405 if (thisarg[0] == '-') for (i = 0; i < ARRAY_SIZE(g_cmdoptions); i++) { 405 if (thisarg[0] != '-') {
406 if (!ENABLE_FEATURE_FBSET_READMODE || argc != 1)
407 bb_show_usage();
408 mode = thisarg;
409 options |= OPT_READMODE;
410 goto contin;
411 }
412 for (i = 0; i < ARRAY_SIZE(g_cmdoptions); i++) {
406 if (strcmp(thisarg + 1, g_cmdoptions[i].name) != 0) 413 if (strcmp(thisarg + 1, g_cmdoptions[i].name) != 0)
407 continue; 414 continue;
408 if (argc <= g_cmdoptions[i].param_count) 415 if (argc <= g_cmdoptions[i].param_count)
@@ -471,10 +478,7 @@ int fbset_main(int argc, char **argv)
471 argv += g_cmdoptions[i].param_count; 478 argv += g_cmdoptions[i].param_count;
472 goto contin; 479 goto contin;
473 } 480 }
474 if (!ENABLE_FEATURE_FBSET_READMODE || argc != 1) 481 bb_show_usage();
475 bb_show_usage();
476 mode = *argv;
477 options |= OPT_READMODE;
478 contin: ; 482 contin: ;
479 } 483 }
480 484