summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/extra_opts.c5
-rw-r--r--lib/tests/test_opts.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/extra_opts.c b/lib/extra_opts.c
index b555417a..7e50c178 100644
--- a/lib/extra_opts.c
+++ b/lib/extra_opts.c
@@ -103,14 +103,13 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name){
103 ea_tmp=extra_args; 103 ea_tmp=extra_args;
104 while(ea_tmp->next) { 104 while(ea_tmp->next) {
105 ea_tmp=ea_tmp->next; 105 ea_tmp=ea_tmp->next;
106 ea_num++;
107 } 106 }
108 ea_tmp->next=ea1; 107 ea_tmp->next=ea1;
108 while(ea1=ea1->next) ea_num++;
109 } 109 }
110 ea1=ea_tmp=NULL; 110 ea1=ea_tmp=NULL;
111 } 111 }
112 /* lather, rince, repeat */ 112 } /* lather, rince, repeat */
113 }
114 113
115 if(ea_num==*argc && extra_args==NULL){ 114 if(ea_num==*argc && extra_args==NULL){
116 /* No extra-opts */ 115 /* No extra-opts */
diff --git a/lib/tests/test_opts.c b/lib/tests/test_opts.c
index b9696dfb..6d6167eb 100644
--- a/lib/tests/test_opts.c
+++ b/lib/tests/test_opts.c
@@ -276,7 +276,7 @@ main (int argc, char **argv)
276 argv_test=(char **)malloc(4*sizeof(char **)); 276 argv_test=(char **)malloc(4*sizeof(char **));
277 argv_test[0] = "check_tcp"; 277 argv_test[0] = "check_tcp";
278 argv_test[1] = "--extra-opts"; 278 argv_test[1] = "--extra-opts";
279 argv_test[2] = "--extra-opts=tcp_long_lines@plugins.ini"; 279 argv_test[2] = "--extra-opts=tcp_long_lines";
280 argv_test[3] = NULL; 280 argv_test[3] = NULL;
281 argc_test=3; 281 argc_test=3;
282 argv_known=(char **)realloc(argv_known, 7*sizeof(char **)); 282 argv_known=(char **)realloc(argv_known, 7*sizeof(char **));