From f723ca58055a6acc7c4c2e8eff8709bd8fdc32b1 Mon Sep 17 00:00:00 2001 From: Avi Eisenberg <613ike@gmail.com> Date: Fri, 7 Feb 2014 11:25:02 -0500 Subject: Fixed bug where exiting textviewer after using up all the bookmarks caused that file unable to be read the next time. Change-Id: I1924fe68c8528c03c4197f74a4f014edb0ac9f2a --- apps/plugins/text_viewer/tv_bookmark.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/plugins/text_viewer/tv_bookmark.c') diff --git a/apps/plugins/text_viewer/tv_bookmark.c b/apps/plugins/text_viewer/tv_bookmark.c index 5f77d2a92c..807c3e9a3b 100644 --- a/apps/plugins/text_viewer/tv_bookmark.c +++ b/apps/plugins/text_viewer/tv_bookmark.c @@ -159,6 +159,9 @@ void tv_create_system_bookmark(void) bookmarks[idx].flag |= TV_BOOKMARK_SYSTEM; else { + /* we can't add a bookmark if there is no room left! */ + if (bookmark_count == TV_MAX_BOOKMARKS) + return; bookmarks[bookmark_count].pos = *pos; bookmarks[bookmark_count].flag = TV_BOOKMARK_SYSTEM; bookmark_count++; -- cgit v1.2.3