From 42ba67eb4b9bbc3453a26f60189888e85d14d1a1 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 12 Feb 2002 21:34:28 +0000 Subject: [PATCH] *sigh*, getting this right is proving to be a pain :P --- libs/console/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/console/client.c b/libs/console/client.c index a6ee630cc..a4fe71315 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -385,9 +385,9 @@ C_Print (const char *fmt, va_list args) static int buffer_size, cr; size = vsnprintf (buffer, buffer_size, fmt, args) + 1; // +1 for nul - while (size < 0 || size > buffer_size) { + while (size <= 0 || size > buffer_size) { if (size > 0) - buffer_size = (size + 1024) % 1024; // 1k multiples + buffer_size = (size + 1023) & ~1023; // 1k multiples else buffer_size += 1024; buffer = realloc (buffer, buffer_size);