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;
|
||||
|
||||
} else if (!strcmp(option, "logging_level")) {
|
||||
if (1 != sscanf(value, "%d", &val) ||
|
||||
val < PRINT_LEVEL_MIN || val > PRINT_LEVEL_MAX)
|
||||
return BAD_VALUE;
|
||||
r = get_ranged_int(value, &val,
|
||||
PRINT_LEVEL_MIN, PRINT_LEVEL_MAX);
|
||||
if (r != PARSED_OK)
|
||||
return r;
|
||||
if (!(cfg_ignore & CFG_IGNORE_PRINT_LEVEL)) {
|
||||
cfg->print_level = val;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue