From 8e6e25c353e95e6566a7dfabbd2ca31b0b9db09e Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 7 Apr 2007 15:31:22 +0000 Subject: Fix NULL pointer access (crashes the sim on windows) in directories with no displayed entries. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13059 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/tree.c b/apps/tree.c index 2b5dba3e18..c3c5ce3239 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -488,7 +488,7 @@ void get_current_file(char* buffer, int buffer_len) struct entry* dc = tc.dircache; struct entry* e = &dc[tc.selected_item]; snprintf(buffer, buffer_len, "%s/%s", getcwd(NULL,0), - e->name); + tc.dirlength ? e->name : ""); } /* Selects a file and update tree context properly */ -- cgit v1.2.3