From 20a8bf1a3ffcdf0e715e03ad654a4a08673e870f Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Mon, 31 Mar 2008 05:31:14 +0000 Subject: 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 --- lib/extra_opts.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/extra_opts.c') 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 +#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; -- cgit v1.2.3-74-g34f1