try to fix bug

This commit is contained in:
Andrew Pamment 2018-02-27 21:50:22 +10:00
parent 29bdc52efa
commit c52c3c2a9b

View File

@ -704,7 +704,7 @@ static char *www_wordwrap(char *content, int cutoff) {
int i;
int line_count = 0;
char *last_space = NULL;
char *ret = (char *)malloc(len + 1);
char *ret;
int at = 0;
int extra = 0;
if (ret == NULL) {
@ -727,6 +727,8 @@ static char *www_wordwrap(char *content, int cutoff) {
content[at] = '\0';
at = 0;
len = strlen(content);
ret = (char *)malloc(len + 1);
for (i=0;i<len;i++) {
if (content[i] == '\n') {
continue;