* Made some annotations regarding bug 368 in the code.
authorArt Cancro <ajc@citadel.org>
Mon, 2 Nov 2009 03:54:39 +0000 (03:54 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 2 Nov 2009 03:54:39 +0000 (03:54 +0000)
citadel/modules/imap/serv_imap.c

index 3efe4a4e494f088e0147e3dbe997dcb1a79af6d0..9cd1452f690abe65dab011021eef0c20bb6152de 100644 (file)
@@ -221,10 +221,8 @@ void imap_add_single_msgid(long msgnum, void *userdata)
        ++IMAP->num_msgs;
        if (IMAP->num_msgs > IMAP->num_alloc) {
                IMAP->num_alloc += REALLOC_INCREMENT;
-               IMAP->msgids = realloc(IMAP->msgids,
-                                       (IMAP->num_alloc * sizeof(long)) );
-               IMAP->flags = realloc(IMAP->flags,
-                                       (IMAP->num_alloc * sizeof(long)) );
+               IMAP->msgids = realloc(IMAP->msgids, (IMAP->num_alloc * sizeof(long)) );
+               IMAP->flags = realloc(IMAP->flags, (IMAP->num_alloc * sizeof(long)) );
        }
        IMAP->msgids[IMAP->num_msgs - 1] = msgnum;
        IMAP->flags[IMAP->num_msgs - 1] = 0;
@@ -282,8 +280,7 @@ void imap_rescan_msgids(void)
        int num_recent = 0;
 
        if (IMAP->selected == 0) {
-               CtdlLogPrintf(CTDL_ERR,
-                       "imap_load_msgids() can't run; no room selected\n");
+               CtdlLogPrintf(CTDL_ERR, "imap_load_msgids() can't run; no room selected\n");
                return;
        }
 
@@ -367,6 +364,8 @@ void imap_rescan_msgids(void)
 
        /*
         * Now peruse the room for *new* messages only.
+        * This logic is probably the cause of Bug # 368
+        * [ http://bugzilla.citadel.org/show_bug.cgi?id=368 ]
         */
        if (num_msgs > 0) {
                for (j = 0; j < num_msgs; ++j) {