summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c12
1 files changed, 8 insertions, 4 deletions
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)
116#endif 116#endif
117 117
118 for ( i=start; i < start+TREE_MAX_ON_SCREEN; i++ ) { 118 for ( i=start; i < start+TREE_MAX_ON_SCREEN; i++ ) {
119 int len = strlen(buffer[i].name); 119 int len;
120
121 if ( i >= filesindir )
122 break;
123
124 len = strlen(buffer[i].name);
120 125
121#ifdef HAVE_LCD_BITMAP 126#ifdef HAVE_LCD_BITMAP
122 if ( buffer[i].file ) 127 if ( buffer[i].file )
123 icon_type=File; 128 icon_type=File;
124 else 129 else
125 icon_type=Folder; 130 icon_type=Folder;
126 lcd_bitmap(bitmap_icons_6x8[icon_type], 6, MARGIN_Y+i*LINE_HEIGTH, 6, 131 lcd_bitmap(bitmap_icons_6x8[icon_type],
127 8, true); 132 6, MARGIN_Y+(i-start)*LINE_HEIGTH, 6, 8, true);
128#endif 133#endif
129 134
130 if(len < TREE_MAX_LEN_DISPLAY) 135 if(len < TREE_MAX_LEN_DISPLAY)
@@ -273,7 +278,6 @@ bool dirbrowse(char *root)
273 numentries = showdir(currdir, start); 278 numentries = showdir(currdir, start);
274 lcd_puts(0, LINE_Y+dircursor, "-"); 279 lcd_puts(0, LINE_Y+dircursor, "-");
275 } 280 }
276 debugf("s:%d d:%d\n",start,dircursor);
277 break; 281 break;
278 282
279#ifdef HAVE_RECORDER_KEYPAD 283#ifdef HAVE_RECORDER_KEYPAD