Fix calculations in clone_update_unexp_hooks()
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 <94aca18939fc64aa4df96ea8cb026da8a2e1541a@gmail.com>
Acked-by: Serge E. Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>

tych0/lxc,Distrotech/lxc,hallyn/lxc,federicobriata/lxc,tych0/lxc,QingweiPeterLan/cs188-lxc,bostjan/lxc,caglar10ur/lxc,Distrotech/lxc,fwilson42/lxc,GreatFruitOmsk/lxc,ksperis/lxc,ss1h2a3tw/lxc,hfuCN/lxc,QingweiPeterLan/cs188-lxc,LynxChaus/lxc,ysbnim/lxc,hfuCN/lxc,terceiro/lxc,LynxChaus/lxc,bostjan/lxc,ksperis/lxc,armcc/lxc,terceiro/lxc,cjwatson/lxc,thmo/lxc,ss1h2a3tw/lxc,LynxChaus/lxc,ysbnim/lxc,akshaykarle/lxc,aeris/lxc,fwilson42/lxc,hfuCN/lxc,caglar10ur/lxc,fwilson42/lxc,caglar10ur/lxc,GreatFruitOmsk/lxc,Distrotech/lxc,thmo/lxc,federicobriata/lxc,tych0/lxc,ksperis/lxc,hallyn/lxc,ss1h2a3tw/lxc,aeris/lxc,terceiro/lxc,armcc/lxc,akshaykarle/lxc,hallyn/lxc,aeris/lxc,cjwatson/lxc,federicobriata/lxc,thmo/lxc,QingweiPeterLan/cs188-lxc,cjwatson/lxc,ysbnim/lxc,bostjan/lxc,armcc/lxc,GreatFruitOmsk/lxc,akshaykarle/lxc