From a9c4e4c9fc11cf1bd17d08e166405f7ab355a9f3 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 19 May 2018 02:39:46 +0800 Subject: memalloc: Add growstackto helper This patch adds the growstackto helper which repeatedly calls growstackblock until the requested size is reached. Signed-off-by: Herbert Xu --- src/exec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/exec.c') diff --git a/src/exec.c b/src/exec.c index d7ced35..c98f14c 100644 --- a/src/exec.c +++ b/src/exec.c @@ -195,9 +195,7 @@ padvance(const char **path, const char *name) start = *path; for (p = start ; *p && *p != ':' && *p != '%' ; p++); len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ - while (stackblocksize() < len) - growstackblock(); - q = stackblock(); + q = growstackto(len); if (p != start) { memcpy(q, start, p - start); q += p - start; -- cgit 1.4.1