confile: cleanup set_config_log_level()

parent 1633b15c
...@@ -1493,13 +1493,17 @@ static int set_config_log_level(const char *key, const char *value, ...@@ -1493,13 +1493,17 @@ static int set_config_log_level(const char *key, const char *value,
} }
if (value[0] >= '0' && value[0] <= '9') { if (value[0] >= '0' && value[0] <= '9') {
if (lxc_safe_int(value, &newlevel) < 0) int ret;
return -1;
ret = lxc_safe_int(value, &newlevel);
if (ret)
return ret_errno(EINVAL);
} else { } else {
newlevel = lxc_log_priority_to_int(value); newlevel = lxc_log_priority_to_int(value);
} }
/* Store these values in the lxc_conf, and then try to set for actual /*
* Store these values in the lxc_conf, and then try to set for actual
* current logging. * current logging.
*/ */
lxc_conf->loglevel = newlevel; lxc_conf->loglevel = newlevel;
......
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