diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-03-31 05:31:14 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-03-31 05:31:14 +0000 |
commit | 20a8bf1a3ffcdf0e715e03ad654a4a08673e870f (patch) | |
tree | 742d894aa5c7a7ee844b855d0a4d6e27ff302cb6 /lib/extra_opts.c | |
parent | 8aa5ec317af49d811b1c4b65c905cca81f845321 (diff) | |
download | monitoring-plugins-20a8bf1a3ffcdf0e715e03ad654a4a08673e870f.tar.gz |
Fix for last commit - I accidentaly broke my local Makefile and tests weren't being re-compiled.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1968 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/extra_opts.c')
-rw-r--r-- | lib/extra_opts.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/extra_opts.c b/lib/extra_opts.c index 2aeb77ac..e4251215 100644 --- a/lib/extra_opts.c +++ b/lib/extra_opts.c @@ -26,10 +26,9 @@ *****************************************************************************/ #include "common.h" -#include "extra_opts.h" -#include "parse_ini.h" #include "utils_base.h" -#include <ctype.h> +#include "parse_ini.h" +#include "extra_opts.h" /* FIXME: copied from utils.h; we should move a bunch of libs! */ int @@ -66,7 +65,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ /* Delete the extra opts argument */ for(j=i;j<*argc;j++) argv[j]=argv[j+1]; i--; - *argc--; + *argc-=1; }else if(strcmp(argv[i], "--extra-opts")==0){ if(!is_option(argv[i+1])){ /* It is a argument with separate value */ @@ -82,7 +81,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ /* Delete the extra opts argument */ for(j=i;j<*argc;j++) argv[j]=argv[j+1]; i--; - *argc--; + *argc-=1; } } @@ -102,7 +101,10 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ while(ea1=ea1->next) ea_num++; }else{ ea_tmp=extra_args; - while(ea_tmp=ea_tmp->next) ea_num++; + while(ea_tmp->next) { + ea_tmp=ea_tmp->next; + ea_num++; + } ea_tmp->next=ea1; } ea1=ea_tmp=NULL; |