summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-11-22 00:32:50 +0000
committerDave Chapman <dave@dchapman.com>2007-11-22 00:32:50 +0000
commit14ac7cafc81940f5f389515cb5134e6c52f37813 (patch)
treedd7e5c5ffe9c25c2b57685eeb58190ab672de716 /apps
parentc44d2bd4cb3a70f4694b0a9962d11258933af8ee (diff)
0 is also a valid file descriptor
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15749 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/viewer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 5891ca9736..d81cc094e5 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -1086,7 +1086,7 @@ static void viewer_load_settings(void) /* same name as global, but not the same
/* read settings file */
settings_fd=rb->open(SETTINGS_FILE, O_RDONLY);
- if (settings_fd && (rb->filesize(settings_fd) == sizeof(struct preferences)))
+ if ((settings_fd >= 0) && (rb->filesize(settings_fd) == sizeof(struct preferences)))
{
rb->read(settings_fd, &prefs, sizeof(struct preferences));
rb->close(settings_fd);