int kanji = 0;
if (resultPtr) {
- /* XXX I think this will work */
- result = malloc(strlen(text) + (strlen(text) / width) + 2);
+ /* worst case is a \n after every character */
+ result = malloc((strlen(text) * 2) + 1);
*result = '\0';
}
}
}
+ result = realloc(result, strlen(result) + 1);
+
if (badness) *badness = howbad;
if (resultPtr) *resultPtr = result;
if (heightPtr) *heightPtr = height;