From ef7b372567dc8c484e7768b9af6214cc12a4c12a Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sat, 20 Aug 2016 14:49:37 +1000 Subject: [PATCH] Fix for double line endings in messages in WWW --- www_msgs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/www_msgs.c b/www_msgs.c index aacf505..f2c9d5a 100644 --- a/www_msgs.c +++ b/www_msgs.c @@ -545,6 +545,8 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference, char *body2; char *tagline; struct utsname name; + int pos; + if (conference < 0 || conference >= conf.mail_conference_count || area < 0 || area >= conf.mail_conferences[conference]->mail_area_count) { return 0; } @@ -676,12 +678,10 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference, } body2 = (char *)malloc(strlen(body) + 2 + strlen(buffer)); memset(body2, 0, strlen(body) + 2 + strlen(buffer)); - + pos = 0; for (z =0;z < strlen(body); z++) { - if (body[z] == '\n') { - body2[z] = '\r'; - } else { - body2[z] = body[z]; + if (body[z] != '\n') { + body2[pos++] = body[z]; } } strcat(body2, buffer);