From 77bd05014d086bc76d42b8be656cb299d811376a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 26 Jan 2005 12:34:31 +0000 Subject: 20750: fix hang with 20742 --- Src/Zle/zle_utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index a3f3d83a4..0e8099bd2 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -67,9 +67,16 @@ void sizeline(int sz) { while (sz > linesz) - zleline = + { + if (linesz < 256) + linesz = 256; + else + linesz *= 4; + + zleline = (ZLE_STRING_T)realloc(zleline, - ((linesz *= 4) + 2) * ZLE_CHAR_SIZE); + (linesz + 2) * ZLE_CHAR_SIZE); + } } /* -- cgit 1.4.1