{
char oldmbox[LONG_STRING];
char newmbox[LONG_STRING];
- char buf[HUGE_STRING];
+ BUFFER *b;
+ int rc = 0;
imap_munge_mbox_name (idata, oldmbox, sizeof (oldmbox), mx->mbox);
imap_munge_mbox_name (idata, newmbox, sizeof (newmbox), newname);
- snprintf (buf, sizeof (buf), "RENAME %s %s", oldmbox, newmbox);
+ b = mutt_buffer_new ();
+ mutt_buffer_increase_size (b, LONG_STRING);
+ mutt_buffer_printf (b, "RENAME %s %s", oldmbox, newmbox);
- if (imap_exec (idata, buf, 0) != 0)
- return -1;
+ if (imap_exec (idata, b->data, 0) != 0)
+ rc = -1;
- return 0;
+ mutt_buffer_free (&b);
+
+ return rc;
}
int imap_delete_mailbox (CONTEXT* ctx, IMAP_MBOX mx)