int pgpinfd, int pgpoutfd, int pgperrfd,
pgp_ring_t keyring, LIST *hints)
{
- char uids[HUGE_STRING];
- char tmpuids[HUGE_STRING];
+ BUFFER *uids;
char quoted[HUGE_STRING];
-
- *uids = '\0';
-
+ pid_t rc;
+
+ uids = mutt_buffer_new ();
+ mutt_buffer_increase_size (uids, HUGE_STRING);
+
for (; hints; hints = hints->next)
{
mutt_quote_filename (quoted, sizeof (quoted), (char *) hints->data);
- snprintf (tmpuids, sizeof (tmpuids), "%s %s", uids, quoted);
- strcpy (uids, tmpuids); /* __STRCPY_CHECKED__ */
+ mutt_buffer_addstr (uids, quoted);
+ if (hints->next)
+ mutt_buffer_addch (uids, ' ');
}
- return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- 0, NULL, NULL, uids,
+ rc = pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
+ 0, NULL, NULL, uids->data,
keyring == PGP_SECRING ? PgpListSecringCommand :
PgpListPubringCommand);
+
+ mutt_buffer_free (&uids);
+ return rc;
}
int mix_send_message (LIST *chain, const char *tempfile)
{
- char cmd[HUGE_STRING];
- char tmp[HUGE_STRING];
+ BUFFER *cmd;
char cd_quoted[STRING];
int i;
- snprintf (cmd, sizeof (cmd), "cat %s | %s -m ", tempfile, Mixmaster);
-
+ cmd = mutt_buffer_new ();
+ mutt_buffer_increase_size (cmd, HUGE_STRING);
+ mutt_buffer_printf (cmd, "cat %s | %s -m ", tempfile, Mixmaster);
+
for (i = 0; chain; chain = chain->next, i = 1)
{
- strfcpy (tmp, cmd, sizeof (tmp));
+ mutt_buffer_addstr (cmd, i ? "," : " -l ");
mutt_quote_filename (cd_quoted, sizeof (cd_quoted), (char *) chain->data);
- snprintf (cmd, sizeof (cmd), "%s%s%s", tmp, i ? "," : " -l ", cd_quoted);
+ mutt_buffer_addstr (cmd, cd_quoted);
}
if (!option (OPTNOCURSES))
mutt_endwin (NULL);
-
- if ((i = mutt_system (cmd)))
+
+ if ((i = mutt_system (cmd->data)))
{
fprintf (stderr, _("Error sending message, child exited %d.\n"), i);
if (!option (OPTNOCURSES))
}
}
+ mutt_buffer_free (&cmd);
unlink (tempfile);
return i;
}
-
+
#endif