case 'I':
if (!optional)
{
- snprintf (dest, destlen, "%c",
- (aptr->content->disposition == DISPINLINE) ? 'I' : 'A');
+ const char dispchar[] = { 'I', 'A', 'F', '-' };
+ char ch;
+
+ if (aptr->content->disposition < sizeof(dispchar))
+ ch = dispchar[aptr->content->disposition];
+ else
+ {
+ dprint(1, (debugfile, "ERROR: invalid content-disposition %d\n", aptr->content->disposition));
+ ch = '!';
+ }
+ snprintf (dest, destlen, "%c", ch);
}
break;
case 'm':
CLEARLINE (LINES-1);
return;
}
- mutt_mktemp (tfile);
+ mutt_mktemp (tfile, sizeof (tfile));
}
else
tfile[0] = 0;
char newfile[_POSIX_PATH_MAX] = "";
FILE *ifp;
- mutt_mktemp (newfile);
+ mutt_mktemp (newfile, sizeof (newfile));
if (mutt_decode_save_attachment (fp, top, newfile, M_PRINTING, 0) == 0)
{
if ((ifp = fopen (newfile, "r")) != NULL)