From 29380252a8bd3d9d0f43a691f3a2a88c7c102999 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 16 Jun 1992 23:43:29 +0000 Subject: [PATCH] Formerly expand.c.~4~ --- expand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/expand.c b/expand.c index 668bb104..1237da17 100644 --- a/expand.c +++ b/expand.c @@ -47,7 +47,9 @@ variable_buffer_output (ptr, string, length) if (newlen > variable_buffer_length) { unsigned int offset = ptr - variable_buffer; - variable_buffer_length = max (2 * variable_buffer_length, newlen + 100); + variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length + ? newlen + 100 + : 2 * variable_buffer_length); variable_buffer = (char *) xrealloc (variable_buffer, variable_buffer_length); ptr = variable_buffer + offset;