From e391cd27527f8f95d53386e583ae761f20cf7e1c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 28 Oct 2011 16:05:34 +0200 Subject: [PATCH] cosmetics/tiny computation saving --- src/xbt/xbt_strbuff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xbt/xbt_strbuff.c b/src/xbt/xbt_strbuff.c index a474b3a258..4af89927a9 100644 --- a/src/xbt/xbt_strbuff.c +++ b/src/xbt/xbt_strbuff.c @@ -78,9 +78,8 @@ void xbt_strbuff_append(xbt_strbuff_t b, const char *toadd) needed_space = b->used + addlen + 1; if (needed_space > b->size) { - b->data = - realloc(b->data, MAX(minimal_increment + b->used, needed_space)); b->size = MAX(minimal_increment + b->used, needed_space); + b->data = realloc(b->data, b->size); } strcpy(b->data + b->used, toadd); b->used += addlen; -- 2.20.1