stop crashing!

This commit is contained in:
Andrew Pamment 2018-02-27 21:40:58 +10:00
parent 9dd95d9181
commit 29bdc52efa

View File

@ -711,19 +711,19 @@ static char *www_wordwrap(char *content, int cutoff) {
return NULL;
}
at = 0;
for (i=0;i<len;i++) {
if (content[i] == '\r' && content[i+1] != '\r' && content[i+1] != '\0') {
for (i=0;i<len-1;i++) {
if (content[i] == '\r' && content[i+1] != '\r') {
content[at++] = ' ';
content[at++] = content[i+1];
i++;
} else if (content[i] == '\r' && content[i+1] == '\r' && content[i+1] != '\0') {
} else if (content[i] == '\r' && content[i+1] == '\r') {
content[at++] = '\r';
i++;
} else {
content[at++] = content[i];
}
}
//content[at++] = content[i];
content[at] = '\0';
at = 0;