summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-07-26 23:36:30 -0600
committerEduardo Chappa <chappa@washington.edu>2015-07-26 23:36:30 -0600
commit2695b63fbe6c6a2206a2637137c6cd654f69943a (patch)
tree717008efdac9ae66bf33985dc99ee68aea45bf11 /pith
parent36b77661542a63c4579943951d143c8cc9c99460 (diff)
downloadalpine-2695b63fbe6c6a2206a2637137c6cd654f69943a.tar.xz
* Clear even more warnings from clang 3.5 and MAC OSX.
Diffstat (limited to 'pith')
-rw-r--r--pith/conf.c2
-rw-r--r--pith/context.c10
-rw-r--r--pith/filter.c2
-rw-r--r--pith/help.c2
-rw-r--r--pith/init.c4
-rw-r--r--pith/mailcmd.c16
-rw-r--r--pith/mailindx.c6
-rw-r--r--pith/mimedesc.c7
-rw-r--r--pith/news.c10
-rw-r--r--pith/pine.hlp2
-rw-r--r--pith/reply.c37
-rw-r--r--pith/save.c27
-rw-r--r--pith/send.c13
-rw-r--r--pith/stream.c6
14 files changed, 75 insertions, 69 deletions
diff --git a/pith/conf.c b/pith/conf.c
index 40fdbcdb..4b2dc384 100644
--- a/pith/conf.c
+++ b/pith/conf.c
@@ -7630,7 +7630,7 @@ panic1(char *message, char *arg)
#define SIZEOFBUF 1001
char buf1[SIZEOFBUF], buf2[SIZEOFBUF];
- snprintf(buf1, sizeof(buf1), "%.*s", MAX(SIZEOFBUF - 1 - strlen(message), 0), arg);
+ snprintf(buf1, sizeof(buf1), "%.*s", (int) MAX(SIZEOFBUF - 1 - strlen(message), 0), arg);
snprintf(buf2, sizeof(buf2), message, buf1);
alpine_panic(buf2);
}
diff --git a/pith/context.c b/pith/context.c
index e92ee678..735cf1c9 100644
--- a/pith/context.c
+++ b/pith/context.c
@@ -190,18 +190,18 @@ context_apply(char *b, CONTEXT_S *c, char *name, size_t len)
else if(name[0] == '#'){
if(IS_REMOTE(c->context)){
char *p = strchr(c->context, '}'); /* name specifies namespace */
- snprintf(b, len, "%.*s", MIN(p - c->context + 1, len-1), c->context);
+ snprintf(b, len, "%.*s", (int) MIN(p - c->context + 1, len-1), c->context);
b[MIN(p - c->context + 1, len-1)] = '\0';
- snprintf(b+strlen(b), len-strlen(b), "%.*s", len-1-strlen(b), name);
+ snprintf(b+strlen(b), len-strlen(b), "%.*s", (int)(len-1-strlen(b)), name);
}
else{
strncpy(b, name, len-1);
}
}
else if(c->dir && c->dir->ref){ /* has reference string! */
- snprintf(b, len, "%.*s", len-1, c->dir->ref);
+ snprintf(b, len, "%.*s", (int) len-1, c->dir->ref);
b[len-1] = '\0';
- snprintf(b+strlen(b), len-strlen(b), "%.*s", len-1-strlen(b), name);
+ snprintf(b+strlen(b), len-strlen(b), "%.*s", (int) (len-1-strlen(b)), name);
}
else{ /* no ref, apply to context */
char *pq = NULL;
@@ -713,7 +713,7 @@ new_context(char *cntxt_string, int *prime)
snprintf(tmp_20k_buf, SIZEOF_20KBUF, "%solders%s%.100s in %.*s%s",
(*host) ? "F" : "Local f", (*host) ? " on " : "",
(*host) ? host : "",
- p ? MIN(p - rcontext, 100) : 0,
+ p ? (int) MIN(p - rcontext, 100) : 0,
rcontext, (p && (p - rcontext) > 0) ? "" : "home directory");
}
diff --git a/pith/filter.c b/pith/filter.c
index 70a89f17..0aa38db5 100644
--- a/pith/filter.c
+++ b/pith/filter.c
@@ -5393,7 +5393,7 @@ html_a_relative(char *base_url, char *rel_url, HANDLE_S *h)
if(len + strlen(rel_path) < sizeof(tmp)-1){
if(len)
- snprintf(path = tmp, sizeof(tmp), "%.*s", len, base_path);
+ snprintf(path = tmp, sizeof(tmp), "%.*s", (int) len, base_path);
strncpy(tmp + len, rel_path, sizeof(tmp)-len);
tmp[sizeof(tmp)-1] = '\0';
diff --git a/pith/help.c b/pith/help.c
index 1c1b9ab1..82917134 100644
--- a/pith/help.c
+++ b/pith/help.c
@@ -40,7 +40,7 @@ help_name2section(char *url, int url_len)
HelpType newhelp = NO_HELP;
struct help_texts *t;
- snprintf(name, sizeof(name), "%.*s", MIN(url_len,sizeof(name)), url);
+ snprintf(name, sizeof(name), "%.*s", (int) MIN(url_len,sizeof(name)), url);
for(t = h_texts; t->help_text != NO_HELP; t++)
if(!strucmp(t->tag, name)){
diff --git a/pith/init.c b/pith/init.c
index 978297f0..ba77f704 100644
--- a/pith/init.c
+++ b/pith/init.c
@@ -378,8 +378,8 @@ get_mail_list(CONTEXT_S *list_cntxt, char *folder_base)
folder_base_len = strlen(searchname) - 1;
}
else
-#endif
- snprintf(searchname, sizeof(searchname), "%.*s*", sizeof(searchname)-2, folder_base);
+#endif /* MAXPATH + 1 = sizeof(searchmane) */
+ snprintf(searchname, sizeof(searchname), "%.*s*", MAXPATH+1-2, folder_base);
build_folder_list(NULL, list_cntxt, searchname, NULL, BFL_FLDRONLY);
diff --git a/pith/mailcmd.c b/pith/mailcmd.c
index f3ac0ede..ff0f7fa2 100644
--- a/pith/mailcmd.c
+++ b/pith/mailcmd.c
@@ -1570,22 +1570,22 @@ expunge_and_close(MAILSTREAM *stream, char **final_msg, long unsigned int flags)
}
}
- if(!no_close){
+ if(!no_close){ /* MAX_SCREEN_COLS+1 = sizeof(buff2) */
unsigned char *fname = folder_name_decoded((unsigned char *)folder);
if(stream->nmsgs){
snprintf(buff2, sizeof(buff2),
"Clos%s folder \"%.*s\". %s%s%s message%s.",
ing,
- sizeof(buff2)-50, pretty_fn((char *) fname),
+ MAX_SCREEN_COLS+1-50, pretty_fn((char *) fname),
final_msg ? "Kept" : "Keeping",
(stream->nmsgs == 1L) ? " single" : " all ",
(stream->nmsgs > 1L)
? comatose(stream->nmsgs) : "",
plural(stream->nmsgs));
}
- else{
+ else{ /* MAX_SCREEN_COLS+1 = sizeof(buff2) */
snprintf(buff2, sizeof(buff2), "Clos%s empty folder \"%.*s\"",
- ing, sizeof(buff2)-50, pretty_fn((char *) fname));
+ ing, MAX_SCREEN_COLS+1-50, pretty_fn((char *) fname));
}
if(fname) fs_give((void **)&fname);
@@ -1616,9 +1616,9 @@ expunge_and_close(MAILSTREAM *stream, char **final_msg, long unsigned int flags)
buff1, sizeof(buff1))) != NULL)
q_status_message(SM_ORDER,
F_ON(F_AUTO_READ_MSGS,ps_global) ? 0 : 3, 5, moved_msg);
-
+ /* MAX_SCREEN_COLS+1 = sizeof(buff2) */
snprintf(buff2, sizeof(buff2), "Clos%s news group \"%.*s\"",
- ing, sizeof(buff2)-50, pretty_fn(folder));
+ ing, MAX_SCREEN_COLS+1-50, pretty_fn(folder));
if(F_ON(F_NEWS_CATCHUP, ps_global)){
MESSAGECACHE *mc;
@@ -1648,11 +1648,11 @@ expunge_and_close(MAILSTREAM *stream, char **final_msg, long unsigned int flags)
if(F_ON(F_NEWS_CROSS_DELETE, ps_global))
cross_delete_crossposts(stream);
}
- else{
+ else{ /* MAX_SCREEN_COLS+1 = sizeof(buff2) */
unsigned char *fname = folder_name_decoded((unsigned char *)folder);
snprintf(buff2, sizeof(buff2),
"Clos%s read-only folder \"%.*s\". No changes to save",
- ing, sizeof(buff2)-60, pretty_fn((char *) fname));
+ ing, MAX_SCREEN_COLS+1-60, pretty_fn((char *) fname));
if(fname) fs_give((void **)&fname);
}
diff --git a/pith/mailindx.c b/pith/mailindx.c
index a1e889e0..586e0d81 100644
--- a/pith/mailindx.c
+++ b/pith/mailindx.c
@@ -6142,7 +6142,7 @@ from_str(IndexColType ctype, INDEXDATA_S *idata, char *str, size_t strsize, ICE_
if(ctype == iFromTo &&
(newsgroups = fetch_newsgroups(idata)) &&
*newsgroups){
- snprintf(fptr, strsize, "To: %-*.*s", strsize-1-4, strsize-1-4,
+ snprintf(fptr, strsize, "To: %-*.*s", (int)(strsize-1-4), (int)(strsize-1-4),
newsgroups);
break;
}
@@ -6174,9 +6174,9 @@ from_str(IndexColType ctype, INDEXDATA_S *idata, char *str, size_t strsize, ICE_
len = strlen(mb);
if(!at || strsize-1 <= len)
- snprintf(fptr, strsize, "%-*.*s", strsize-1, strsize-1, mb);
+ snprintf(fptr, strsize, "%-*.*s", (int)(strsize-1), (int)(strsize-1), mb);
else
- snprintf(fptr, strsize, "%s@%-*.*s", mb, strsize-1-len-1, strsize-1-len-1, hst);
+ snprintf(fptr, strsize, "%s@%-*.*s", mb, (int)(strsize-1-len-1), (int)(strsize-1-len-1), hst);
}
break;
diff --git a/pith/mimedesc.c b/pith/mimedesc.c
index 80d2f840..dbe83f18 100644
--- a/pith/mimedesc.c
+++ b/pith/mimedesc.c
@@ -70,8 +70,9 @@ void
describe_mime(struct mail_bodystruct *body, char *prefix, int num,
int should_show, int multalt, int flags)
{
+#define NUMXLEN 512
PART *part;
- char numx[512], string[800], *description;
+ char numx[NUMXLEN], string[800], *description;
int n, named = 0, can_display_ext;
ATTACH_S *a;
@@ -279,8 +280,8 @@ describe_mime(struct mail_bodystruct *body, char *prefix, int num,
(a+1)->description = NULL;
if(body->type == TYPEMESSAGE && body->encoding <= ENCBASE64
&& body->subtype && strucmp(body->subtype, "rfc822") == 0){
- body = body->nested.msg->body;
- snprintf(numx, sizeof(numx), "%.*s%d.", sizeof(numx)-20, prefix, num);
+ body = body->nested.msg->body; /* NUMXLEN = sizeof(numx) */
+ snprintf(numx, sizeof(numx), "%.*s%d.", NUMXLEN-20, prefix, num);
numx[sizeof(numx)-1] = '\0';
describe_mime(body, numx, 1, should_show, 0, flags);
}
diff --git a/pith/news.c b/pith/news.c
index 0c90d3af..ea1982cf 100644
--- a/pith/news.c
+++ b/pith/news.c
@@ -221,9 +221,9 @@ news_grouper(char *given_group, char **expanded_group, char **error,
*/
for(server = ps_global->VAR_NNTP_SERVER;
server && *server && **server;
- server++){
+ server++){ /* MAILTMPLEN = sizeof(ng_ref) */
snprintf(ng_ref, sizeof(ng_ref), "{%.*s/nntp}#news.",
- sizeof(ng_ref)-30, *server);
+ MAILTMPLEN-30, *server);
if((stream = pine_mail_open(stream, ng_ref,
OP_HALFOPEN|SP_USEPOOL|SP_TEMPUSE,
NULL)) != NULL)
@@ -267,10 +267,10 @@ news_grouper(char *given_group, char **expanded_group, char **error,
* interface...
*/
for(ntmp = nglist; ntmp; ntmp = ntmp->next){
- if(ntmp->found == NotInCache){
+ if(ntmp->found == NotInCache){ /* MAILTMPLEN = sizeof(ng_ref) */
snprintf(ng_ref, sizeof(ng_ref), "{%.*s/nntp}#news.%.*s",
- sizeof(ng_ref)/2 - 10, *server,
- sizeof(ng_ref)/2 - 10, ntmp->groupname);
+ MAILTMPLEN/2 - 10, *server,
+ MAILTMPLEN/2 - 10, ntmp->groupname);
ps_global->noshow_error = 1;
stream = pine_mail_open(stream, ng_ref,
OP_SILENT|SP_USEPOOL|SP_TEMPUSE,
diff --git a/pith/pine.hlp b/pith/pine.hlp
index ee0a1bdd..08b13780 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 84 2015-07-26 14:15:47
+Alpine Commit 85 2015-07-26 23:36:26
============= h_news =================
<HTML>
<HEAD>
diff --git a/pith/reply.c b/pith/reply.c
index 834b945a..0ab8dfe7 100644
--- a/pith/reply.c
+++ b/pith/reply.c
@@ -769,17 +769,17 @@ reply_subject(char *subject, char *buf, size_t buflen)
&& (decoded[1] == 'E' || decoded[1] == 'e')){
if(decoded[2] == ':')
- snprintf(buf, buflen, "%.*s", buflen-1, subject);
+ snprintf(buf, buflen, "%.*s", (int)(buflen-1), subject);
else if((decoded[2] == '[') && (p = strchr(decoded, ']'))){
p++;
while(*p && isspace((unsigned char)*p)) p++;
if(p[0] == ':')
- snprintf(buf, buflen, "%.*s", buflen-1, subject);
+ snprintf(buf, buflen, "%.*s", (int)(buflen-1), subject);
}
}
if(!buf[0])
- snprintf(buf, buflen, "Re: %.*s", buflen-1,
+ snprintf(buf, buflen, "Re: %.*s", (int)(buflen-1),
(subject && *subject) ? subject : "your mail");
buf[buflen-1] = '\0';
@@ -937,14 +937,15 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
long int msgno, char *sect_prefix, void *msgtext, char *prefix,
int plustext, ACTION_S *role, int toplevel, REDRAFT_POS_S **redraft_pos)
{
- char *p, *sig = NULL, *section, sect_buf[256];
+#define SECTBUFLEN 256
+ char *p, *sig = NULL, *section, sect_buf[SECTBUFLEN];
BODY *body = NULL, *tmp_body = NULL;
PART *part;
gf_io_t pc;
int impl, template_len = 0, leave_cursor_at_top = 0, reply_raw_body = 0;
- if(sect_prefix)
- snprintf(section = sect_buf, sizeof(sect_buf), "%.*s.1", sizeof(sect_buf)-1, sect_prefix);
+ if(sect_prefix) /* SECTBUFLEN = sizeof(sect_buf) */
+ snprintf(section = sect_buf, sizeof(sect_buf), "%.*s.1", SECTBUFLEN-1, sect_prefix);
else
section = "1";
@@ -1152,12 +1153,12 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
if(F_ON(F_INCLUDE_HEADER, ps_global))
reply_forward_header(stream, msgno, sect_prefix,
env, pc, prefix);
-
+ /* SECTBUFLEN = sizeof(sect_buf) */
snprintf(sect_buf, sizeof(sect_buf), "%.*s%s%.*s",
- sizeof(sect_buf)/2-2,
+ SECTBUFLEN/2-2,
sect_prefix ? sect_prefix : "",
sect_prefix ? "." : "",
- sizeof(sect_buf)/2-2,
+ SECTBUFLEN/2-2,
p = partno(orig_body, tmp_body));
sect_buf[sizeof(sect_buf)-1] = '\0';
fs_give((void **) &p);
@@ -1173,10 +1174,10 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
body->nested.part->body.subtype = cpystr("Plain");
body->nested.part->body.contents.text.data = msgtext;
body->nested.part->next = part;
-
+ /* SECTBUFLEN = sizeof(sect_buf) */
for(partnum = 2; part != NULL; part = part->next){
snprintf(sect_buf, sizeof(sect_buf), "%.*s%s%d",
- sizeof(sect_buf)/2,
+ SECTBUFLEN/2,
sect_prefix ? sect_prefix : "",
sect_prefix ? "." : "", partnum++);
sect_buf[sizeof(sect_buf)-1] = '\0';
@@ -2919,18 +2920,19 @@ body_partno(MAILSTREAM *stream, long int msgno, struct mail_bodystruct *end_body
char *
partno(struct mail_bodystruct *body, struct mail_bodystruct *end_body)
{
+#define PARTTMPLEN 64
PART *part;
int num = 0;
- char tmp[64], *p = NULL;
+ char tmp[PARTTMPLEN], *p = NULL;
if(body && body->type == TYPEMULTIPART) {
part = body->nested.part; /* first body part */
do { /* for each part */
- num++;
+ num++; /* PARTTMPLEN = sizeof(tmp) */
if(&part->body == end_body || (p = partno(&part->body, end_body))){
snprintf(tmp, sizeof(tmp), "%d%s%.*s", num, (p) ? "." : "",
- sizeof(tmp)-10, (p) ? p : "");
+ PARTTMPLEN-10, (p) ? p : "");
tmp[sizeof(tmp)-1] = '\0';
if(p)
fs_give((void **)&p);
@@ -3593,9 +3595,10 @@ BODY *
forward_multi_alt(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
long int msgno, char *sect_prefix, void *msgtext, gf_io_t pc, int flags)
{
+#define FWDTMPLEN 256
BODY *body = NULL;
PART *part = NULL, *bestpart = NULL;
- char tmp_buf[256];
+ char tmp_buf[FWDTMPLEN];
char *new_charset = NULL;
int partnum, bestpartnum;
@@ -3650,9 +3653,9 @@ forward_multi_alt(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *ori
forward_delimiter(pc);
reply_forward_header(stream, msgno, sect_prefix, env, pc, "");
}
-
+ /* FWDTMPLEN = sizeof(tmp_buf) */
snprintf(tmp_buf, sizeof(tmp_buf), "%.*s%s%s%d",
- sizeof(tmp_buf)/2, sect_prefix ? sect_prefix : "",
+ FWDTMPLEN/2, sect_prefix ? sect_prefix : "",
sect_prefix ? "." : "", flags & FWD_NESTED ? "1." : "",
partnum);
tmp_buf[sizeof(tmp_buf)-1] = '\0';
diff --git a/pith/save.c b/pith/save.c
index 46a4d66a..67f080af 100644
--- a/pith/save.c
+++ b/pith/save.c
@@ -1466,15 +1466,16 @@ save_ex_output_body(MAILSTREAM *stream, long int raw, char *section,
return(save_ex_replace_body(txtp, len, body, pc));
if(body->type == TYPEMULTIPART){
- char *subsect, boundary[128];
+#define BOUNDARYLEN 128
+ char *subsect, boundary[BOUNDARYLEN];
int n, blen;
PART *part = body->nested.part;
PARAMETER *param;
/* Locate supplied multipart boundary */
for (param = body->parameter; param; param = param->next)
- if (!strucmp(param->attribute, "boundary")){
- snprintf(boundary, sizeof(boundary), "--%.*s\015\012", sizeof(boundary)-10,
+ if (!strucmp(param->attribute, "boundary")){ /* BOUNDARYLEN == sizeof(boundary) */
+ snprintf(boundary, sizeof(boundary), "--%.*s\015\012", BOUNDARYLEN-10,
param->value);
blen = strlen(boundary);
break;
@@ -1516,8 +1517,8 @@ save_ex_output_body(MAILSTREAM *stream, long int raw, char *section,
return(0);
}
while ((part = part->next) != NULL); /* until done */
-
- snprintf(boundary, sizeof(boundary), "--%.*s--\015\012", sizeof(boundary)-10,param->value);
+ /* BOUNDARYLEN = sizeof(boundary) */
+ snprintf(boundary, sizeof(boundary), "--%.*s--\015\012", BOUNDARYLEN-10,param->value);
*len += blen + 2;
return(gf_puts(boundary, pc));
}
@@ -1618,10 +1619,10 @@ save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int
PART *part = body->nested.part; /* first body part */
*len = 0;
- if(body->description && *body->description){
+ if(body->description && *body->description){ /* MAILTMPLEN = sizeof(tmp) */
snprintf(tmp, sizeof(tmp), "%*.*sA %s/%.*s%.10s%.100s%.10s segment described",
depth, depth, " ", body_type_names(body->type),
- sizeof(tmp)-300, body->subtype ? body->subtype : "Unknown",
+ MAILTMPLEN-300, body->subtype ? body->subtype : "Unknown",
name ? " (Name=\"" : "",
name ? name : "",
name ? "\")" : "");
@@ -1633,11 +1634,11 @@ save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int
(char *) rfc1522_decode_to_utf8((unsigned char *)tmp_20k_buf,
SIZEOF_20KBUF, buftmp));
}
- else{
+ else{ /* MAILTMPLEN = sizeof(tmp) */
snprintf(tmp, sizeof(tmp), "%*.*sA %s/%.*s%.10s%.100s%.10s segment containing:",
depth, depth, " ",
body_type_names(body->type),
- sizeof(tmp)-300, body->subtype ? body->subtype : "Unknown",
+ MAILTMPLEN-300, body->subtype ? body->subtype : "Unknown",
name ? " (Name=\"" : "",
name ? name : "",
name ? "\")" : "");
@@ -1656,11 +1657,11 @@ save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int
return(0);
while ((part = part->next) != NULL); /* until done */
}
- else{
+ else{ /* MAILTMPLEN = sizeof(tmp) */
snprintf(tmp, sizeof(tmp), "%*.*sA %s/%.*s%.10s%.100s%.10s segment of about %s bytes%s",
depth, depth, " ",
body_type_names(body->type),
- sizeof(tmp)-300, body->subtype ? body->subtype : "Unknown",
+ MAILTMPLEN-300, body->subtype ? body->subtype : "Unknown",
name ? " (Name=\"" : "",
name ? name : "",
name ? "\")" : "",
@@ -1671,10 +1672,10 @@ save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int
if(!save_ex_output_line(tmp, len, pc))
return(0);
- if(body->description && *body->description){
+ if(body->description && *body->description){ /* MAILTMPLEN = sizeof(tmp) */
snprintf(buftmp, sizeof(buftmp), "%.75s", body->description);
snprintf(tmp, sizeof(tmp), "%*.*s described as \"%.*s\"", depth, depth, " ",
- sizeof(tmp)-100,
+ MAILTMPLEN-100,
(char *) rfc1522_decode_to_utf8((unsigned char *)tmp_20k_buf,
SIZEOF_20KBUF, buftmp));
if(save_ex_output_line(tmp, &ilen, pc))
diff --git a/pith/send.c b/pith/send.c
index 1ba6266f..017265c9 100644
--- a/pith/send.c
+++ b/pith/send.c
@@ -5490,10 +5490,11 @@ smtp_command(char *errbuf, size_t errbuflen)
errbuf[errbuflen-1] = '\0';
#else /* UNIX */
# if defined(SENDMAIL) && defined(SENDMAILFLAGS)
- char tmp[256];
-
- snprintf(tmp, sizeof(tmp), "%.*s %.*s", (sizeof(tmp)-3)/2, SENDMAIL,
- (sizeof(tmp)-3)/2, SENDMAILFLAGS);
+#define SENDTMPLEN 256
+ char tmp[SENDTMPLEN];
+ /* SENDTMPLEN == sizeof(tmp) */
+ snprintf(tmp, sizeof(tmp), "%.*s %.*s", (SENDTMPLEN-3)/2, SENDMAIL,
+ (SENDTMPLEN-3)/2, SENDMAILFLAGS);
return(cpystr(tmp));
# else
strncpy(errbuf, _("No default posting command."), errbuflen);
@@ -5750,9 +5751,9 @@ piped_smtp_open (char *host, char *service, long unsigned int port)
if(strucmp(host, "localhost")){
char tmp[MAILTMPLEN];
-
+ /* MAILTMPLEN = sizeof(tmp) */
snprintf(tmp, sizeof(tmp), _("Unexpected hostname for piped SMTP: %.*s"),
- sizeof(tmp)-50, host);
+ MAILTMPLEN-50, host);
tmp[sizeof(tmp)-1] = '\0';
mm_log(tmp, ERROR);
}
diff --git a/pith/stream.c b/pith/stream.c
index 5cce21ce..3c4923b1 100644
--- a/pith/stream.c
+++ b/pith/stream.c
@@ -1909,9 +1909,9 @@ mail_list_internal(MAILSTREAM *s, char *r, char *p)
&& ((s && s->mailbox && *s->mailbox == '{')
|| (!s && ((r && *r == '{') || (p && *p == '{'))))){
char tmp[2*MAILTMPLEN];
-
- snprintf(tmp, sizeof(tmp), "%.*s%.*s", sizeof(tmp)/2-1, r ? r : "",
- sizeof(tmp)/2-1, p);
+ /* MAILTMPLEN = sizeof(tmp)/2 */
+ snprintf(tmp, sizeof(tmp), "%.*s%.*s", MAILTMPLEN-1, r ? r : "",
+ MAILTMPLEN-1, p);
mail_list(s, "", tmp);
}
else