config: Apply config value validation to logging_level option
Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>master
parent
306f83e7b1
commit
a92f42de38
7
config.c
7
config.c
|
@ -309,9 +309,10 @@ static enum parser_result parse_global_setting(const char *option,
|
||||||
*cfg->udp6_scope = u8;
|
*cfg->udp6_scope = u8;
|
||||||
|
|
||||||
} else if (!strcmp(option, "logging_level")) {
|
} else if (!strcmp(option, "logging_level")) {
|
||||||
if (1 != sscanf(value, "%d", &val) ||
|
r = get_ranged_int(value, &val,
|
||||||
val < PRINT_LEVEL_MIN || val > PRINT_LEVEL_MAX)
|
PRINT_LEVEL_MIN, PRINT_LEVEL_MAX);
|
||||||
return BAD_VALUE;
|
if (r != PARSED_OK)
|
||||||
|
return r;
|
||||||
if (!(cfg_ignore & CFG_IGNORE_PRINT_LEVEL)) {
|
if (!(cfg_ignore & CFG_IGNORE_PRINT_LEVEL)) {
|
||||||
cfg->print_level = val;
|
cfg->print_level = val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue