From ee6bb24563f8b341db41731d84b22b5e33fa59b3 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Tue, 15 Aug 2006 11:19:56 +0000 Subject: [PATCH] Fixed wrong truncation of email recipient SVN revision: 1714 --- src/elogd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 305910ab..0c8d8b3f 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -19675,10 +19675,11 @@ void submit_elog(LOGBOOK * lbs) } if (strlen(mail_to) > 0) { - mail_to[strlen(mail_to) - 4] = 0; /* strip last ',\r\n\t' */ - rcpt_to[strlen(rcpt_to) - 1] = 0; /* strip last ',' */ - puts(mail_to); - puts(rcpt_to); + if (strlen(mail_to) > 4 && mail_to[strlen(mail_to) - 4] == ',') + mail_to[strlen(mail_to) - 4] = 0; /* strip last ',\r\n\t' */ + + if (strlen(rcpt_to) > 1 && mail_to[strlen(rcpt_to) - 1] == ',') + rcpt_to[strlen(rcpt_to) - 1] = 0; /* strip last ',' */ if (compose_email (lbs, rcpt_to, mail_to, message_id, attrib, mail_param, isparam("edit_id"), att_file, isparam("encoding") ? getparam("encoding") : "plain") == 0)