]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/serv_imap.c
* imap_fetch_rfc822(): migrate to strbuf
[citadel.git] / citadel / modules / imap / serv_imap.c
index 3bd31dc7caab020966c0823008f4c2012e9f7e4a..461cb1737f4148e4369db4fefeded7ca8dd1302d 100644 (file)
@@ -413,9 +413,8 @@ void imap_cleanup_function(void)
        imap_free_msgids();
        imap_free_transmitted_message();
 
-       if (IMAP->cached_rfc822_data != NULL) {
-               free(IMAP->cached_rfc822_data);
-               IMAP->cached_rfc822_data = NULL;
+       if (IMAP->cached_rfc822 != NULL) {
+               FreeStrBuf(&IMAP->cached_rfc822);
                IMAP->cached_rfc822_msgnum = (-1);
                IMAP->cached_rfc822_withbody = 0;
        }
@@ -505,7 +504,6 @@ void imap_greeting(void)
        CC->session_specific_data = malloc(sizeof(citimap));
        memset(IMAP, 0, sizeof(citimap));
        IMAP->authstate = imap_as_normal;
-       IMAP->cached_rfc822_data = NULL;
        IMAP->cached_rfc822_msgnum = (-1);
        IMAP->cached_rfc822_withbody = 0;
 
@@ -888,7 +886,7 @@ void imap_namespace(int num_parms, ConstStr *Params)
        int i;
        struct floor *fl;
        int floors = 0;
-       char buf[SIZ];
+       char Namespace[SIZ];
 
        cprintf("* NAMESPACE ");
 
@@ -905,8 +903,8 @@ void imap_namespace(int num_parms, ConstStr *Params)
                if (fl->f_flags & F_INUSE) {
                        if (floors > 0) cprintf(" ");
                        cprintf("(");
-                       snprintf(buf, sizeof(buf), "%s/", fl->f_name);
-                       plain_imap_strout(buf);
+                       snprintf(Namespace, sizeof(Namespace), "%s/", fl->f_name);
+                       plain_imap_strout(Namespace);
                        cprintf(" \"/\")");
                        ++floors;
                }