mirror of
https://github.com/sheumann/hush.git
synced 2025-02-22 10:29:10 +00:00
fbset: abort on unknown options. closes 3121
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
ed607a87e0
commit
12bc152b31
@ -402,7 +402,14 @@ int fbset_main(int argc, char **argv)
|
|||||||
argv++;
|
argv++;
|
||||||
argc--;
|
argc--;
|
||||||
for (; argc > 0 && (thisarg = *argv) != NULL; argc--, argv++) {
|
for (; argc > 0 && (thisarg = *argv) != NULL; argc--, argv++) {
|
||||||
if (thisarg[0] == '-') for (i = 0; i < ARRAY_SIZE(g_cmdoptions); i++) {
|
if (thisarg[0] != '-') {
|
||||||
|
if (!ENABLE_FEATURE_FBSET_READMODE || argc != 1)
|
||||||
|
bb_show_usage();
|
||||||
|
mode = thisarg;
|
||||||
|
options |= OPT_READMODE;
|
||||||
|
goto contin;
|
||||||
|
}
|
||||||
|
for (i = 0; i < ARRAY_SIZE(g_cmdoptions); i++) {
|
||||||
if (strcmp(thisarg + 1, g_cmdoptions[i].name) != 0)
|
if (strcmp(thisarg + 1, g_cmdoptions[i].name) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (argc <= g_cmdoptions[i].param_count)
|
if (argc <= g_cmdoptions[i].param_count)
|
||||||
@ -471,10 +478,7 @@ int fbset_main(int argc, char **argv)
|
|||||||
argv += g_cmdoptions[i].param_count;
|
argv += g_cmdoptions[i].param_count;
|
||||||
goto contin;
|
goto contin;
|
||||||
}
|
}
|
||||||
if (!ENABLE_FEATURE_FBSET_READMODE || argc != 1)
|
bb_show_usage();
|
||||||
bb_show_usage();
|
|
||||||
mode = *argv;
|
|
||||||
options |= OPT_READMODE;
|
|
||||||
contin: ;
|
contin: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user