Blob Blame History Raw
diff -up newt-0.52.10/textbox.c.orig newt-0.52.10/textbox.c
--- newt-0.52.10/textbox.c.orig	2008-07-30 14:42:55.000000000 +0200
+++ newt-0.52.10/textbox.c	2009-09-21 14:59:24.000000000 +0200
@@ -179,7 +179,7 @@ static void doReflow(const char * text, 
 
     if (resultPtr) {
 	/* XXX I think this will work */
-	result = malloc(strlen(text) + (strlen(text) / width) + 2);
+	result = malloc(strlen(text) + (strlen(text) / (width - 1)) + 2);
 	*result = '\0';
     }