From: ewt Date: Tue, 30 Oct 2001 01:18:29 +0000 (+0000) Subject: may be alright... strncat in dietlibc borked (sorry for the slander msw) X-Git-Tag: r0-50-35~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba6b89db20f9a7c9d5f48896738a5a1ef37a9ba9;p=thirdparty%2Fnewt.git may be alright... strncat in dietlibc borked (sorry for the slander msw) --- diff --git a/textbox.c b/textbox.c index 06fa47c..dc42dc5 100644 --- a/textbox.c +++ b/textbox.c @@ -159,8 +159,8 @@ static void doReflow(const char * text, char ** resultPtr, int width, int kanji = 0; if (resultPtr) { - /* worst case is a \n after every character */ - result = malloc((strlen(text) * 2) + 1); + /* XXX I think this will work */ + result = malloc(strlen(text) + (strlen(text) / width) + 2); *result = '\0'; } @@ -227,8 +227,6 @@ static void doReflow(const char * text, char ** resultPtr, int width, } } - result = realloc(result, strlen(result) + 1); - if (badness) *badness = howbad; if (resultPtr) *resultPtr = result; if (heightPtr) *heightPtr = height;