Commit 118269c0 authored by Alessandro Rubini's avatar Alessandro Rubini

lib/conf: report errors even if diagnostic is off

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 91f559d3
...@@ -411,16 +411,15 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno) ...@@ -411,16 +411,15 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
case ARG_INT: case ARG_INT:
if (sscanf(line, "%i", &(cfg_arg.i)) != 1) { if (sscanf(line, "%i", &(cfg_arg.i)) != 1) {
pp_diag(NULL, config, 1, "line %i: \"%s\": not int\n", pp_error("line %i: \"%s\": not int\n", lineno, word);
lineno, word);
return -1; return -1;
} }
break; break;
case ARG_INT2: case ARG_INT2:
if (sscanf(line, "%i,%i", cfg_arg.i2, &cfg_arg.i2[1]) < 0) { if (sscanf(line, "%i,%i", cfg_arg.i2, &cfg_arg.i2[1]) < 0) {
pp_diag(NULL, config, 1, "line %i: wrong arg \"%s\"" pp_error("line %i: wrong arg \"%s\" for \"%s\"\n",
" for \"%s\"\n", lineno, line, word); lineno, line, word);
return -1; return -1;
} }
break; break;
...@@ -437,8 +436,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno) ...@@ -437,8 +436,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
if (!strcmp(line, n->name)) if (!strcmp(line, n->name))
break; break;
if (!n->name) { if (!n->name) {
pp_diag(NULL, config, 1, "line %i: wrong arg \"%s\"" pp_error("line %i: wrong arg \"%s\" for \"%s\"\n",
" for \"%s\"\n", lineno, line, word); lineno, line, word);
return -1; return -1;
} }
cfg_arg.i = n->value; cfg_arg.i = n->value;
...@@ -446,8 +445,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno) ...@@ -446,8 +445,8 @@ static int pp_config_line(struct pp_globals *ppg, char *line, int lineno)
case ARG_TIME: case ARG_TIME:
if(parse_time(&cfg_arg.ts, line)) { if(parse_time(&cfg_arg.ts, line)) {
pp_diag(NULL, config, 1, "line %i: wrong arg \"%s\" for " pp_error("line %i: wrong arg \"%s\" for \"%s\"\n",
"\"%s\"\n", lineno, line, word); lineno, line, word);
return -1; return -1;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment