From cfad07e359064567d8723407aa0163489e21673d Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Thu, 20 Sep 2001 04:55:08 +0000 Subject: Truncate extremely long subjects. (inspired by bug #9158) 2001-09-19 Jon Trowbridge * mail-callbacks.c (mail_generate_reply): Truncate extremely long subjects. (inspired by bug #9158) * mail-tools.c (mail_tool_generate_forward_subject): Truncate extremely long subjects. (bug #9158) svn path=/trunk/; revision=13007 --- mail/mail-tools.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mail/mail-tools.c') diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 09603eb458..5e0d3ee9ee 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -206,11 +206,16 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg) { const char *subject; char *fwd_subj; + const int max_subject_length = 1024; subject = camel_mime_message_get_subject(msg); if (subject && *subject) { - fwd_subj = g_strdup_printf ("[Fwd: %s]", subject); + /* Truncate insanely long subjects */ + if (strlen (subject) < max_subject_length) + fwd_subj = g_strdup_printf ("[Fwd: %s]", subject); + else + fwd_subj = g_strdup_printf ("[Fwd: %.*s...]", max_subject_length, subject); } else { const CamelInternetAddress *from; char *fromstr; -- cgit