summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/parse_ini.c8
-rw-r--r--lib/parse_ini.h2
-rw-r--r--lib/tests/test_opts.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 96551cf..654452d 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -304,7 +304,7 @@ static char* default_file(void){
304 size_t len; 304 size_t len;
305 305
306 if((np_env=getenv("NAGIOS_CONFIG_PATH"))!=NULL) { 306 if((np_env=getenv("NAGIOS_CONFIG_PATH"))!=NULL) {
307 /* skip ant starting colon... */ 307 /* skip any starting colon... */
308 while(*np_env==':') np_env++; 308 while(*np_env==':') np_env++;
309 /* Look for NP_DEFAULT_INI_FILENAME1 and NP_DEFAULT_INI_FILENAME2 in 309 /* Look for NP_DEFAULT_INI_FILENAME1 and NP_DEFAULT_INI_FILENAME2 in
310 * every PATHs defined (colon-separated). 310 * every PATHs defined (colon-separated).
@@ -340,8 +340,8 @@ static char* default_file(void){
340 default_file=strdup(temp_file); 340 default_file=strdup(temp_file);
341 } 341 }
342 342
343 /* Return default_file or empty string (should return NULL if we want to 343 /* Return default_file or empty string (should return NULL if we want plugins
344 * die there... 344 * to die there)...
345 */ 345 */
346 if(default_file) 346 if(default_file)
347 return default_file; 347 return default_file;
@@ -354,7 +354,7 @@ static char* default_file(void){
354static int test_file(const char* env, int len, const char* file, char* temp_file){ 354static int test_file(const char* env, int len, const char* file, char* temp_file){
355 struct stat sb; 355 struct stat sb;
356 356
357 /* test for len + filelen + '/' + '\0' */ 357 /* test if len + filelen + '/' + '\0' fits in temp_file */
358 if((len+strlen(file)+2)>MAX_INPUT_BUFFER) return -1; 358 if((len+strlen(file)+2)>MAX_INPUT_BUFFER) return -1;
359 359
360 strncpy(temp_file,env,len); 360 strncpy(temp_file,env,len);
diff --git a/lib/parse_ini.h b/lib/parse_ini.h
index 6357a0e..e0ba816 100644
--- a/lib/parse_ini.h
+++ b/lib/parse_ini.h
@@ -14,7 +14,7 @@ typedef struct np_arg_el {
14} np_arg_list; 14} np_arg_list;
15 15
16/* FIXME: This is in plugins/common.c. Should be eventually moved to lib/ 16/* FIXME: This is in plugins/common.c. Should be eventually moved to lib/
17 * (although for this particular one a configure settings should be ideal) 17 * (although for this particular one a configure settings should be ideal)
18 */ 18 */
19#ifndef MAX_INPUT_BUFFER 19#ifndef MAX_INPUT_BUFFER
20# define MAX_INPUT_BUFFER 8192 20# define MAX_INPUT_BUFFER 8192
diff --git a/lib/tests/test_opts.c b/lib/tests/test_opts.c
index e878abd..e6623d1 100644
--- a/lib/tests/test_opts.c
+++ b/lib/tests/test_opts.c
@@ -145,7 +145,7 @@ main (int argc, char **argv)
145 ok(array_diff(argc_test, argv_test, 7, argv_known), "twice extra opts using two sections"); 145 ok(array_diff(argc_test, argv_test, 7, argv_known), "twice extra opts using two sections");
146 my_free(&argc_test,argv_test); 146 my_free(&argc_test,argv_test);
147 147
148 /* Next three checks dre expected to die. They are commented out as they 148 /* Next three checks are expected to die. They are commented out as they
149 * could possibly go in a sepatare test checked for return value. 149 * could possibly go in a sepatare test checked for return value.
150 */ 150 */
151 /* argv_test=(char **)malloc(6*sizeof(char **)); 151 /* argv_test=(char **)malloc(6*sizeof(char **));