diff options
-rw-r--r-- | apps/plugins/viewer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index 8590283c57..543b5c0d1d 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c | |||
@@ -1095,13 +1095,14 @@ static void viewer_load_settings(void) /* same name as global, but not the same | |||
1095 | settings_fd = rb->creat(BOOKMARKS_FILE); | 1095 | settings_fd = rb->creat(BOOKMARKS_FILE); |
1096 | if (settings_fd >=0 ) | 1096 | if (settings_fd >=0 ) |
1097 | { | 1097 | { |
1098 | if (++(data->bookmarked_files_count) > MAX_BOOKMARKED_FILES) | 1098 | if ((data->bookmarked_files_count + 1) > MAX_BOOKMARKED_FILES) |
1099 | data->bookmarked_files_count = MAX_BOOKMARKED_FILES; /* dump the older files */ | 1099 | data->bookmarked_files_count = MAX_BOOKMARKED_FILES; /* dump the older files */ |
1100 | else data->bookmarked_files_count++; | ||
1100 | rb->write (settings_fd, &data->bookmarked_files_count, sizeof(signed int)); | 1101 | rb->write (settings_fd, &data->bookmarked_files_count, sizeof(signed int)); |
1101 | rb->PREFIX(lseek)(settings_fd,sizeof(struct bookmarked_file_info),SEEK_CUR); | 1102 | rb->PREFIX(lseek)(settings_fd,sizeof(struct bookmarked_file_info),SEEK_CUR); |
1102 | // rb->memset(&dummy,0,sizeof(struct bookmarked_file_info)); /* the actual info will be written on exit */ | 1103 | // rb->memset(&dummy,0,sizeof(struct bookmarked_file_info)); /* the actual info will be written on exit */ |
1103 | //rb->write (settings_fd, &dummy, sizeof(struct bookmarked_file_info)); | 1104 | //rb->write (settings_fd, &dummy, sizeof(struct bookmarked_file_info)); |
1104 | rb->write (settings_fd, data->bookmarks, sizeof(struct bookmarked_file_info)*(data->bookmarked_files_count-1)); | 1105 | rb->write (settings_fd, data->bookmarks, sizeof(struct bookmarked_file_info)*(data->bookmarked_files_count)); |
1105 | rb->close(settings_fd); | 1106 | rb->close(settings_fd); |
1106 | } | 1107 | } |
1107 | } | 1108 | } |