From d043862c154070b2c58172289899dd14776e2d03 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Mon, 31 Mar 2008 07:04:07 +0000 Subject: Fix bug with --extra-opts as last argument with no value Fix problem with duplicate function name (function should eventually move to /lib) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1969 f882894a-f735-0410-b71e-b25c423dba1c --- lib/extra_opts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/extra_opts.c') diff --git a/lib/extra_opts.c b/lib/extra_opts.c index e4251215..d46d124f 100644 --- a/lib/extra_opts.c +++ b/lib/extra_opts.c @@ -32,7 +32,7 @@ /* FIXME: copied from utils.h; we should move a bunch of libs! */ int -is_option (char *str) +is_option2 (char *str) { if (!str) return 0; @@ -67,7 +67,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ i--; *argc-=1; }else if(strcmp(argv[i], "--extra-opts")==0){ - if(!is_option(argv[i+1])){ + if((i+1<*argc)&&!is_option2(argv[i+1])){ /* It is a argument with separate value */ argptr=argv[i+1]; /* Delete the extra-opts argument/value */ -- cgit v1.2.3-74-g34f1