Commit 3b56f032 by Christian Brauner Committed by Stéphane Graber

tools/lxc_ls: use lxc_safe_uint()

parent 0dd2eef2
...@@ -459,8 +459,14 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args, ...@@ -459,8 +459,14 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
goto put_and_next; goto put_and_next;
tmp = ls_get_config_item(c, "lxc.start.auto", running); tmp = ls_get_config_item(c, "lxc.start.auto", running);
if (tmp) if (tmp) {
l->autostart = atoi(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); free(tmp);
if (running) { 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