diff --git a/src/www_msgs.c b/src/www_msgs.c index f35a901..e03ca62 100644 --- a/src/www_msgs.c +++ b/src/www_msgs.c @@ -784,7 +784,7 @@ static char *www_wordwrap(char *content, int cutoff) { } else if (line_count == cutoff) { // wrap if (quote_line == 1) { - while (content[i] != '\r') { + while (i < len - 1 && content[i + 1] != '\r') { i++; } last_space = NULL;