diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-03-31 05:31:14 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-03-31 05:31:14 (GMT) |
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 2aeb77a..e425121 100644 --- a/lib/extra_opts.c +++ b/lib/extra_opts.c | |||
@@ -26,10 +26,9 @@ | |||
26 | *****************************************************************************/ | 26 | *****************************************************************************/ |
27 | 27 | ||
28 | #include "common.h" | 28 | #include "common.h" |
29 | #include "extra_opts.h" | ||
30 | #include "parse_ini.h" | ||
31 | #include "utils_base.h" | 29 | #include "utils_base.h" |
32 | #include <ctype.h> | 30 | #include "parse_ini.h" |
31 | #include "extra_opts.h" | ||
33 | 32 | ||
34 | /* 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! */ |
35 | int | 34 | int |
@@ -66,7 +65,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ | |||
66 | /* Delete the extra opts argument */ | 65 | /* Delete the extra opts argument */ |
67 | for(j=i;j<*argc;j++) argv[j]=argv[j+1]; | 66 | for(j=i;j<*argc;j++) argv[j]=argv[j+1]; |
68 | i--; | 67 | i--; |
69 | *argc--; | 68 | *argc-=1; |
70 | }else if(strcmp(argv[i], "--extra-opts")==0){ | 69 | }else if(strcmp(argv[i], "--extra-opts")==0){ |
71 | if(!is_option(argv[i+1])){ | 70 | if(!is_option(argv[i+1])){ |
72 | /* It is a argument with separate value */ | 71 | /* It is a argument with separate value */ |
@@ -82,7 +81,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ | |||
82 | /* Delete the extra opts argument */ | 81 | /* Delete the extra opts argument */ |
83 | for(j=i;j<*argc;j++) argv[j]=argv[j+1]; | 82 | for(j=i;j<*argc;j++) argv[j]=argv[j+1]; |
84 | i--; | 83 | i--; |
85 | *argc--; | 84 | *argc-=1; |
86 | } | 85 | } |
87 | } | 86 | } |
88 | 87 | ||
@@ -102,7 +101,10 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){ | |||
102 | while(ea1=ea1->next) ea_num++; | 101 | while(ea1=ea1->next) ea_num++; |
103 | }else{ | 102 | }else{ |
104 | ea_tmp=extra_args; | 103 | ea_tmp=extra_args; |
105 | while(ea_tmp=ea_tmp->next) ea_num++; | 104 | while(ea_tmp->next) { |
105 | ea_tmp=ea_tmp->next; | ||
106 | ea_num++; | ||
107 | } | ||
106 | ea_tmp->next=ea1; | 108 | ea_tmp->next=ea1; |
107 | } | 109 | } |
108 | ea1=ea_tmp=NULL; | 110 | ea1=ea_tmp=NULL; |