From: Thomas Guyot-Sionnest Date: Sat, 15 Mar 2008 20:34:15 +0000 (+0000) Subject: Fix handling of leading and trailing spaces in stanza X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=40c123148a9d84218667124a97283f7cb93bfa50;p=nagiosplug.git 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 --- diff --git a/lib/parse_ini.c b/lib/parse_ini.c index b555316..38bcb39 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;