use memset to clear the msgstats in folder_realloc
[mmh] / sbr / seq_read.c
index 041f632..4cc4223 100644 (file)
@@ -210,9 +210,14 @@ seq_init(struct msgs *mp, char *name, char *field)
                        ** We iterate through messages in this range
                        ** and flip on bit for this sequence.
                        */
+                       if (k > mp->hghoff) {
+                               if (!(mp = folder_realloc(mp, mp->lowoff, k))) {
+                                       adios(EX_OSERR, NULL, "unable to allocate folder storage");
+                               }
+                               mp->hghoff = k;
+                       }
                        for (; j <= k; j++) {
-                               if (j >= mp->lowmsg && j <= mp->hghmsg &&
-                                               does_exist(mp, j))
+                               if (j >= mp->lowmsg && j <= mp->hghoff)
                                        add_sequence(mp, i, j);
                        }
                }