tools/lxc_ls: use lxc_safe_uint()

parent 45419e74
......@@ -459,8 +459,14 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
goto put_and_next;
tmp = ls_get_config_item(c, "lxc.start.auto", running);
if (tmp)
l->autostart = atoi(tmp);
if (tmp) {
unsigned int astart = 0;
if (lxc_safe_uint(tmp, &astart) < 0)
WARN("Could not parse value for 'lxc.start.auto'.");
if (astart > 1)
DEBUG("Wrong value for 'lxc.start.auto = %d'.", astart);
l->autostart = astart == 1 ? true : false;
}
free(tmp);
if (running) {
......
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