/* util.c */
int imap_parse_path(const char *path, struct ConnAccount *account, char *mailbox, size_t mailboxlen);
-void imap_pretty_mailbox(char *path, const char *folder);
+void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder);
int imap_wait_keepalive(pid_t pid);
void imap_keepalive(void);
/**
* imap_pretty_mailbox - Prettify an IMAP mailbox name
- * @param path Mailbox name to be tidied
- * @param folder Path to use for '+' abbreviations
+ * @param path Mailbox name to be tidied
+ * @param pathlen Length of path
+ * @param folder Path to use for '+' abbreviations
*
* Called by mutt_pretty_mailbox() to make IMAP paths look nice.
*/
-void imap_pretty_mailbox(char *path, const char *folder)
+void imap_pretty_mailbox(char *path, size_t pathlen, const char *folder)
{
struct ConnAccount target_conn_account, home_conn_account;
struct Url url;
fallback:
mutt_account_tourl(&target_conn_account, &url);
url.path = target_mailbox;
- /* FIXME: That hard-coded constant is bogus. But we need the actual
- * size of the buffer from mutt_pretty_mailbox. And these pretty
- * operations usually shrink the result. Still... */
- url_tostring(&url, path, 1024, 0);
+ url_tostring(&url, path, pathlen, 0);
}
/**
if ((scheme == U_IMAP) || (scheme == U_IMAPS))
{
- imap_pretty_mailbox(buf, C_Folder);
+ imap_pretty_mailbox(buf, buflen, C_Folder);
return;
}