tools: don't assert on 64+ commandline arguments, just return
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>master
parent
d480f053d2
commit
ba52e34dce
|
@ -171,6 +171,10 @@ def test_xkbcli_version(xkbcli):
|
|||
assert stderr == ''
|
||||
|
||||
|
||||
def test_xkbcli_too_many_args(xkbcli):
|
||||
xkbcli.run_command_invalid(['a'] * 64)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('args', [['--verbose'],
|
||||
['--rmlvo'],
|
||||
['--kccgst'],
|
||||
|
|
|
@ -229,7 +229,10 @@ tools_exec_command(const char *prefix, int real_argc, char **real_argv)
|
|||
char executable[128];
|
||||
const char *command;
|
||||
|
||||
assert((size_t)real_argc < ARRAY_SIZE(argv));
|
||||
if (((size_t)real_argc >= ARRAY_SIZE(argv))) {
|
||||
fprintf(stderr, "Too many arguments\n");
|
||||
return EXIT_INVALID_USAGE;
|
||||
}
|
||||
|
||||
command = real_argv[0];
|
||||
|
||||
|
|
Loading…
Reference in New Issue