From 88f62fb98ac0d9cf15aadf0b96421fbbad544abb Mon Sep 17 00:00:00 2001 From: Nils Larsch Date: Tue, 10 May 2005 09:52:39 +0000 Subject: [PATCH] improve command line argument checking PR: 1061 --- apps/engine.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/engine.c b/apps/engine.c index 12283d0aed..e8a599f9e5 100644 --- a/apps/engine.c +++ b/apps/engine.c @@ -387,11 +387,15 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv,"-pre") == 0) { argc--; argv++; + if (argc == 0) + goto skip_arg_loop; sk_push(pre_cmds,*argv); } else if (strcmp(*argv,"-post") == 0) { argc--; argv++; + if (argc == 0) + goto skip_arg_loop; sk_push(post_cmds,*argv); } else if ((strncmp(*argv,"-h",2) == 0) || -- 2.25.1