* src/folder.c
[claws.git] / src / folder.c
index b91fa29f2befbc07f4f5664eb49dd8117c437007..56f62db9e843a0f7175724a5e7764a5f8fb4eaf4 100644 (file)
@@ -934,8 +934,10 @@ gint folder_item_scan(FolderItem *item)
                cache_cur_num = ((MsgInfo *)cache_list_cur->data)->msgnum;
                cache_list_last = g_slist_last(cache_list);
                cache_max_num = ((MsgInfo *)cache_list_last->data)->msgnum;
-       } else
+       } else {
                cache_cur_num = G_MAXINT;
+               cache_max_num = 0;
+       }
 
        if (folder_list_cur != NULL) {
                GSList *folder_list_last;
@@ -943,8 +945,10 @@ gint folder_item_scan(FolderItem *item)
                folder_cur_num = GPOINTER_TO_INT(folder_list_cur->data);
                folder_list_last = g_slist_last(folder_list);
                folder_max_num = GPOINTER_TO_INT(folder_list_last->data);
-       } else
+       } else {
                folder_cur_num = G_MAXINT;
+               folder_max_num = 0;
+       }
 
        while ((cache_cur_num != G_MAXINT) || (folder_cur_num != G_MAXINT)) {
                /*