From f03d691af1d62bdaf7997e832354759ecd5f241c Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Wed, 29 May 2002 08:18:46 +0000 Subject: Fixed bad display on recorder git-svn-id: svn://svn.rockbox.org/rockbox/trunk@774 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index c2d9b216a5..b0f82ce2f6 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -116,15 +116,20 @@ static int showdir(char *path, int start) #endif for ( i=start; i < start+TREE_MAX_ON_SCREEN; i++ ) { - int len = strlen(buffer[i].name); + int len; + + if ( i >= filesindir ) + break; + + len = strlen(buffer[i].name); #ifdef HAVE_LCD_BITMAP if ( buffer[i].file ) icon_type=File; else icon_type=Folder; - lcd_bitmap(bitmap_icons_6x8[icon_type], 6, MARGIN_Y+i*LINE_HEIGTH, 6, - 8, true); + lcd_bitmap(bitmap_icons_6x8[icon_type], + 6, MARGIN_Y+(i-start)*LINE_HEIGTH, 6, 8, true); #endif if(len < TREE_MAX_LEN_DISPLAY) @@ -273,7 +278,6 @@ bool dirbrowse(char *root) numentries = showdir(currdir, start); lcd_puts(0, LINE_Y+dircursor, "-"); } - debugf("s:%d d:%d\n",start,dircursor); break; #ifdef HAVE_RECORDER_KEYPAD -- cgit v1.2.3