aboutsummaryrefslogtreecommitdiff
path: root/src/utils.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/utils.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/utils.c')
-rw-r--r--src/utils.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils.c b/src/utils.c
index 42b294e1..16602697 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1950,7 +1950,7 @@ gint remove_numbered_files(const gchar *dir, guint first, guint last)
DIR *dp;
struct dirent *d;
gchar *prev_dir;
- gint fileno;
+ gint file_no;
prev_dir = g_get_current_dir();
@@ -1967,8 +1967,8 @@ gint remove_numbered_files(const gchar *dir, guint first, guint last)
}
while ((d = readdir(dp)) != NULL) {
- fileno = to_number(d->d_name);
- if (fileno >= 0 && first <= fileno && fileno <= last) {
+ file_no = to_number(d->d_name);
+ if (file_no > 0 && first <= file_no && file_no <= last) {
if (is_dir_exist(d->d_name))
continue;
if (unlink(d->d_name) < 0)
@@ -2000,7 +2000,7 @@ gint remove_expired_files(const gchar *dir, guint hours)
struct dirent *d;
struct stat s;
gchar *prev_dir;
- gint fileno;
+ gint file_no;
time_t mtime, now, expire_time;
prev_dir = g_get_current_dir();
@@ -2021,8 +2021,8 @@ gint remove_expired_files(const gchar *dir, guint hours)
expire_time = hours * 60 * 60;
while ((d = readdir(dp)) != NULL) {
- fileno = to_number(d->d_name);
- if (fileno >= 0) {
+ file_no = to_number(d->d_name);
+ if (file_no > 0) {
if (stat(d->d_name, &s) < 0) {
FILE_OP_ERROR(d->d_name, "stat");
continue;