From 40c123148a9d84218667124a97283f7cb93bfa50 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Sat, 15 Mar 2008 20:34:15 +0000 Subject: Fix handling of leading and trailing spaces in stanza git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1947 f882894a-f735-0410-b71e-b25c423dba1c --- lib/parse_ini.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/parse_ini.c b/lib/parse_ini.c index b555316e..38bcb39b 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c @@ -126,6 +126,8 @@ static np_arg_list* read_defaults(FILE *f, const char *stanza){ stanzastate=WRONGSTANZA; for(i=0; iarg=(char *)malloc(cfg_len+1); /* 1-character params needs only one dash */ - if (opt_len==1) { + if(opt_len==1) { strncpy(&optnew->arg[read_pos], "-", 1); read_pos+=1; } else { @@ -263,10 +267,10 @@ static int add_option(FILE *f, np_arg_list **optlst){ optnew->arg[read_pos]='\0'; /* ...and put that to the end of the list */ - if (*optlst==NULL) { + if(*optlst==NULL) { *optlst=optnew; } else { - while (opttmp->next!=NULL) { + while(opttmp->next!=NULL) { opttmp=opttmp->next; } opttmp->next = optnew; -- cgit v1.2.3-74-g34f1