]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/confile.c
Fix calculations in clone_update_unexp_hooks()
authorChristian Brauner <christianvanbrauner@gmail.com>
Tue, 3 Nov 2015 18:09:56 +0000 (19:09 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 6 Nov 2015 18:28:23 +0000 (13:28 -0500)
commitd546aa0e7ebcb93ed3e17781c3803be33b8fbc8e
treed807f16ef7eaf883badee3a3f417fb8ee0e4424f
parent030ce9a9656c08eb0ba5b469132437874215bed4
Fix calculations in clone_update_unexp_hooks()

Changes v3:
(1) Fix typo (q --> p).

(1) This commit fixes the calculations when updating paths in lxc.hooks.*
    entries. We now also update conf->unexpandend_alloced which hasn't been
done prior to this commit.

(2) Also we use the stricter check:

     if (p >= lend)
     continue;

    This should deal better with invalid config files.

(3) Insert some spaces between operators to increase readability.

(4) Use gotos to simplify function and increase readability.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/confile.c