summaryrefslogtreecommitdiffstats
path: root/lib/parse_ini.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2014-01-25 09:13:32 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2014-01-25 09:13:32 (GMT)
commit25a289f307270bb8f814a2df923aeab50acd50c6 (patch)
treee8eb38fd3b0bd5db34ff5ab63ac9ec60b533aaa8 /lib/parse_ini.c
parent4caf4ce4fe3a0f08f129a4537c4173d1e6b6d752 (diff)
downloadmonitoring-plugins-25a289f307270bb8f814a2df923aeab50acd50c6.tar.gz
Clean up parse_ini error messages, add missing newlines
Diffstat (limited to 'lib/parse_ini.c')
-rw-r--r--lib/parse_ini.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/parse_ini.c b/lib/parse_ini.c
index 05d6a02..76953e9 100644
--- a/lib/parse_ini.c
+++ b/lib/parse_ini.c
@@ -101,7 +101,7 @@ np_arg_list* np_get_defaults(const char *locator, const char *default_section){
101 } else { 101 } else {
102 inifile=fopen(i.file, "r"); 102 inifile=fopen(i.file, "r");
103 } 103 }
104 if(inifile==NULL) die(STATE_UNKNOWN, _("Can't read config file")); 104 if(inifile==NULL) die(STATE_UNKNOWN, "%s\n", _("Can't read config file"));
105 if(read_defaults(inifile, i.stanza, &defaults)==FALSE) 105 if(read_defaults(inifile, i.stanza, &defaults)==FALSE)
106 die(STATE_UNKNOWN, _("Invalid section '%s' in config file '%s'\n"), i.stanza, i.file); 106 die(STATE_UNKNOWN, _("Invalid section '%s' in config file '%s'\n"), i.stanza, i.file);
107 107
@@ -163,7 +163,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){
163 * we're dealing with a config error 163 * we're dealing with a config error
164 */ 164 */
165 case NOSTANZA: 165 case NOSTANZA:
166 die(STATE_UNKNOWN, _("Config file error")); 166 die(STATE_UNKNOWN, "%s\n", _("Config file error"));
167 break; 167 break;
168 /* we're in a stanza, but for a different plugin */ 168 /* we're in a stanza, but for a different plugin */
169 case WRONGSTANZA: 169 case WRONGSTANZA:
@@ -173,7 +173,7 @@ static int read_defaults(FILE *f, const char *stanza, np_arg_list **opts){
173 case RIGHTSTANZA: 173 case RIGHTSTANZA:
174 ungetc(c, f); 174 ungetc(c, f);
175 if(add_option(f, opts)){ 175 if(add_option(f, opts)){
176 die(STATE_UNKNOWN, _("Config file error")); 176 die(STATE_UNKNOWN, "%s\n", _("Config file error"));
177 } 177 }
178 status=TRUE; 178 status=TRUE;
179 break; 179 break;
@@ -229,7 +229,7 @@ static int add_option(FILE *f, np_arg_list **optlst){
229 if(optend==NULL) optend=eqptr; 229 if(optend==NULL) optend=eqptr;
230 --optend; 230 --optend;
231 /* ^[[:space:]]*=foo is a syntax error */ 231 /* ^[[:space:]]*=foo is a syntax error */
232 if(optptr==eqptr) die(STATE_UNKNOWN, _("Config file error\n")); 232 if(optptr==eqptr) die(STATE_UNKNOWN, "%s\n", _("Config file error"));
233 /* continue from '=' to start of value or EOL */ 233 /* continue from '=' to start of value or EOL */
234 for(valptr=eqptr+1; valptr<lineend && isspace(*valptr); valptr++); 234 for(valptr=eqptr+1; valptr<lineend && isspace(*valptr); valptr++);
235 /* continue to the end of value */ 235 /* continue to the end of value */
@@ -256,7 +256,7 @@ static int add_option(FILE *f, np_arg_list **optlst){
256 cfg_len+=1; 256 cfg_len+=1;
257 } 257 }
258 /* A line with no equal sign isn't valid */ 258 /* A line with no equal sign isn't valid */
259 if(equals==0) die(STATE_UNKNOWN, _("Config file error\n")); 259 if(equals==0) die(STATE_UNKNOWN, "%s\n", _("Config file error"));
260 260
261 /* okay, now we have all the info we need, so we create a new np_arg_list 261 /* okay, now we have all the info we need, so we create a new np_arg_list
262 * element and set the argument... 262 * element and set the argument...