From 20feeed2dffcc21c2fee57f63eed56a41a2f5dd0 Mon Sep 17 00:00:00 2001 From: nls Date: Sun, 6 Dec 2009 21:11:51 +0000 Subject: [PATCH] FS#10834 by Alex Bennee, fixing off-by-one bug in code calling format_track_path git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23879 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/playlist.c b/apps/playlist.c index 0c4fe9785..fba9b6f4b 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1348,7 +1348,7 @@ static int get_filename(struct playlist_info* playlist, int index, int seek, if (playlist->filenames[index] != NULL) { dircache_copy_path(playlist->filenames[index], tmp_buf, sizeof(tmp_buf)-1); - max = strlen(tmp_buf) + 1; + max = strlen(tmp_buf); } } #else @@ -1357,8 +1357,7 @@ static int get_filename(struct playlist_info* playlist, int index, int seek, if (playlist->in_ram && !control_file && max < 0) { - strlcpy(tmp_buf, &playlist->buffer[seek], sizeof(tmp_buf)); - max = strlen(tmp_buf) + 1; + max = strlcpy(tmp_buf, &playlist->buffer[seek], sizeof(tmp_buf)); } else if (max < 0) { -- 2.11.4.GIT