From 83d3f1d3f65e4115bc5a8348d126b6ab7cbbcf64 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 27 Mar 2013 22:43:40 +1100 Subject: simplelist: Fix simplelist_set_line_count() so it actually sets the count (hopefully) Fixes FS#12838 Change-Id: I932184afaf7b65121a0c459cd03c8482e3bad22b --- apps/gui/list.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/list.c b/apps/gui/list.c index cc43843..2703237 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -843,8 +843,12 @@ void simplelist_set_line_count(int lines) simplelist_line_remaining = sizeof(simplelist_buffer); simplelist_line_count = 0; } - else if (lines >= SIMPLELIST_MAX_LINES) - simplelist_line_count = SIMPLELIST_MAX_LINES; + else if (lines < simplelist_line_count) { + char *end = simplelist_text[lines]; + simplelist_line_pos = end - simplelist_buffer; + simplelist_line_remaining = sizeof(simplelist_buffer) - simplelist_line_pos; + simplelist_line_count = lines; + } } /* get the current amount of lines shown */ int simplelist_get_line_count(void) -- cgit v1.1