Alternative fix for www crashes

This commit is contained in:
Andrew Pamment 2018-10-30 19:34:04 +10:00
parent c5f59d252d
commit d719141f68

View File

@ -831,7 +831,7 @@ static char *www_wordwrap(char *content, int cutoff) {
at = 0; at = 0;
len = strlen(content); len = strlen(content);
for (i = 0; i < len - 2; i++) { for (i = 0; i < len - 1; i++) {
if (content[i] == '>' && line_count < 4) { if (content[i] == '>' && line_count < 4) {
quote_line = 1; quote_line = 1;
} }
@ -857,7 +857,7 @@ static char *www_wordwrap(char *content, int cutoff) {
line_count = 0; line_count = 0;
quote_line = 0; quote_line = 0;
} }
} else if (content[i] == '\r' && content[i + 1] == '\r') { } else if (i < len - 2 && content[i] == '\r' && content[i + 1] == '\r') {
content[at++] = '\r'; content[at++] = '\r';
content[at++] = '\r'; content[at++] = '\r';
line_count = 0; line_count = 0;