diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2013-03-27 22:43:40 +1100 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2013-03-28 22:32:57 +1100 |
commit | 83d3f1d3f65e4115bc5a8348d126b6ab7cbbcf64 (patch) | |
tree | 48172c3cce071f1d099146cb9324f54ab1e66b13 /apps/gui/list.c | |
parent | ddf55200dc89b2917c6c541546b64c2ece73cd5b (diff) | |
download | rockbox-83d3f1d3f65e4115bc5a8348d126b6ab7cbbcf64.tar.gz rockbox-83d3f1d3f65e4115bc5a8348d126b6ab7cbbcf64.tar.bz2 rockbox-83d3f1d3f65e4115bc5a8348d126b6ab7cbbcf64.zip |
simplelist: Fix simplelist_set_line_count() so it actually sets the count
(hopefully) Fixes FS#12838
Change-Id: I932184afaf7b65121a0c459cd03c8482e3bad22b
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index cc43843e46..27032378c3 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) |