summaryrefslogtreecommitdiff
path: root/pith/reply.c
diff options
context:
space:
mode:
Diffstat (limited to 'pith/reply.c')
-rw-r--r--pith/reply.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/pith/reply.c b/pith/reply.c
index 49aaf33c..41ae9fe6 100644
--- a/pith/reply.c
+++ b/pith/reply.c
@@ -1,10 +1,6 @@
-#if !defined(lint) && !defined(DOS)
-static char rcsid[] = "$Id: reply.c 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $";
-#endif
-
/*
* ========================================================================
- * Copyright 2013-2021 Eduardo Chappa
+ * Copyright 2013-2022 Eduardo Chappa
* Copyright 2006-2008 University of Washington
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -945,7 +941,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
int impl, template_len = 0, leave_cursor_at_top = 0, reply_raw_body = 0;
if(sect_prefix) /* SECTBUFLEN = sizeof(sect_buf) */
- snprintf(section = sect_buf, sizeof(sect_buf), "%.*s.1", SECTBUFLEN-1, sect_prefix);
+ snprintf(section = sect_buf, sizeof(sect_buf), "%.*s.1", SECTBUFLEN-3, sect_prefix);
else
section = "1";
@@ -2329,12 +2325,12 @@ forward_subject(ENVELOPE *env, int flags)
tmp_20k_buf[SIZEOF_20KBUF-1] = '\0';
removing_trailing_white_space(tmp_20k_buf);
- if((l = strlen(tmp_20k_buf)) < 1000 &&
- (l < 5 || strcmp(tmp_20k_buf+l-5,"(fwd)"))){
- snprintf(tmp_20k_buf+2000, SIZEOF_20KBUF-2000, "%s (fwd)", tmp_20k_buf);
- tmp_20k_buf[SIZEOF_20KBUF-2000-1] = '\0';
- memmove(tmp_20k_buf, tmp_20k_buf+2000, strlen(tmp_20k_buf+2000));
- tmp_20k_buf[strlen(tmp_20k_buf+2000)] = '\0';
+ l = strlen(tmp_20k_buf);
+ if(l < 5 || strcmp(tmp_20k_buf+l-5,"(fwd)")){
+ char *s = cpystr(tmp_20k_buf);
+ snprintf(tmp_20k_buf, SIZEOF_20KBUF, "%.1000s (fwd)", s);
+ tmp_20k_buf[SIZEOF_20KBUF-1] = '\0';
+ fs_give((void **) &s);
}
/*
@@ -3064,7 +3060,7 @@ partno(struct mail_bodystruct *body, struct mail_bodystruct *end_body)
num++; /* PARTTMPLEN = sizeof(tmp) */
if(&part->body == end_body || (p = partno(&part->body, end_body))){
snprintf(tmp, sizeof(tmp), "%d%s%.*s", num, (p) ? "." : "",
- PARTTMPLEN-10, (p) ? p : "");
+ PARTTMPLEN-12, (p) ? p : "");
tmp[sizeof(tmp)-1] = '\0';
if(p)
fs_give((void **)&p);
@@ -3701,7 +3697,6 @@ forward_multi_alt_mixed(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruc
BODY *body = NULL, *text_body = NULL;
PART *part = NULL;
char prefix_buf[FWDTMPLEN];
- char *new_charset = NULL;
int partnum;
char *section, sect_buf[256];
int forward_raw_body = 0;