aboutsummaryrefslogtreecommitdiff
path: root/src/mh.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-19 08:18:53 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-01-19 08:18:53 +0000
commit670d6b52fe5910aa6fdc3c4a510a37ea6e2b00dc (patch)
treeb1dc5bf84d5386dcf7f34571224a2a6ee544ca67 /src/mh.c
parentb303c834f7f1fcf25035d709135b2a114c1110c0 (diff)
fixed crash when opening 0-numbered message.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@20 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mh.c')
-rw-r--r--src/mh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mh.c b/src/mh.c
index 7c7e5bd3..60ada344 100644
--- a/src/mh.c
+++ b/src/mh.c
@@ -715,7 +715,7 @@ static gint mh_scan_folder_full(Folder *folder, FolderItem *item,
folder->ui_func(folder, item, folder->ui_func_data);
while ((d = readdir(dp)) != NULL) {
- if ((num = to_number(d->d_name)) >= 0 &&
+ if ((num = to_number(d->d_name)) > 0 &&
dirent_is_regular_file(d)) {
n_msg++;
if (max < num)
@@ -974,7 +974,7 @@ static GSList *mh_get_uncached_msgs(GHashTable *msg_table, FolderItem *item)
if (msg_table) {
while ((d = readdir(dp)) != NULL) {
- if ((num = to_number(d->d_name)) < 0) continue;
+ if ((num = to_number(d->d_name)) <= 0) continue;
msginfo = g_hash_table_lookup
(msg_table, GUINT_TO_POINTER(num));
@@ -997,7 +997,7 @@ static GSList *mh_get_uncached_msgs(GHashTable *msg_table, FolderItem *item)
} else {
/* discard all previous cache */
while ((d = readdir(dp)) != NULL) {
- if (to_number(d->d_name) < 0) continue;
+ if (to_number(d->d_name) <= 0) continue;
msginfo = mh_parse_msg(d->d_name, item);
if (!msginfo) continue;
@@ -1227,7 +1227,7 @@ static void mh_scan_tree_recursive(FolderItem *item)
}
mh_scan_tree_recursive(new_item);
- } else if (to_number(d->d_name) != -1) n_msg++;
+ } else if (to_number(d->d_name) > 0) n_msg++;
g_free(entry);
g_free(utf8entry);