summaryrefslogtreecommitdiffstats
path: root/lib/extra_opts.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-03-31 07:04:07 +0000
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-03-31 07:04:07 +0000
commitd043862c154070b2c58172289899dd14776e2d03 (patch)
tree2b660e8f4a73d0237b7dabf7faaad4a17bbe69b6 /lib/extra_opts.c
parent20a8bf1a3ffcdf0e715e03ad654a4a08673e870f (diff)
downloadmonitoring-plugins-d043862c154070b2c58172289899dd14776e2d03.tar.gz
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
Diffstat (limited to 'lib/extra_opts.c')
-rw-r--r--lib/extra_opts.c4
1 files changed, 2 insertions, 2 deletions
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 @@
32 32
33/* FIXME: copied from utils.h; we should move a bunch of libs! */ 33/* FIXME: copied from utils.h; we should move a bunch of libs! */
34int 34int
35is_option (char *str) 35is_option2 (char *str)
36{ 36{
37 if (!str) 37 if (!str)
38 return 0; 38 return 0;
@@ -67,7 +67,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
67 i--; 67 i--;
68 *argc-=1; 68 *argc-=1;
69 }else if(strcmp(argv[i], "--extra-opts")==0){ 69 }else if(strcmp(argv[i], "--extra-opts")==0){
70 if(!is_option(argv[i+1])){ 70 if((i+1<*argc)&&!is_option2(argv[i+1])){
71 /* It is a argument with separate value */ 71 /* It is a argument with separate value */
72 argptr=argv[i+1]; 72 argptr=argv[i+1];
73 /* Delete the extra-opts argument/value */ 73 /* Delete the extra-opts argument/value */