From: Christian Brauner Date: Sat, 17 Feb 2018 16:08:58 +0000 (+0100) Subject: cgfsng: append_null_to_list() X-Git-Tag: lxc-3.0.0.beta1~22^2~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b8db2f6af8e2c1fea02553800d7cee861c465c3;p=thirdparty%2Flxc.git cgfsng: append_null_to_list() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index dbd4ff2c6..dd47ad714 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -211,18 +211,18 @@ static void *must_alloc(size_t sz) return must_realloc(NULL, sz); } -/* - * Given a pointer to a null-terminated array of pointers, realloc to - * add one entry, and point the new entry to NULL. Do not fail. Return - * the index to the second-to-last entry - that is, the one which is - * now available for use (keeping the list null-terminated). +/* Given a pointer to a null-terminated array of pointers, realloc to add one + * entry, and point the new entry to NULL. Do not fail. Return the index to the + * second-to-last entry - that is, the one which is now available for use + * (keeping the list null-terminated). */ static int append_null_to_list(void ***list) { int newentry = 0; if (*list) - for (; (*list)[newentry]; newentry++); + for (; (*list)[newentry]; newentry++) + ; *list = must_realloc(*list, (newentry + 2) * sizeof(void **)); (*list)[newentry + 1] = NULL;