From dd48aa265faa6de7e42f2cf66d7022c6817dedb4 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 17 Feb 2018 17:08:58 +0100 Subject: [PATCH] cgfsng: append_null_to_list() Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 514fb4060..856da3266 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -206,18 +206,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; -- 2.47.2