From e0637255341a165e1e186e6f2836c614f0121c8b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 20 Jun 2011 20:12:15 +0000 Subject: Dircache: Return the size of the result string in dircache_copy_path() so that callers don't need to call strlen on it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30034 a1c6a512-1295-4272-9138-f99709370657 --- apps/playlist.c | 4 ++-- apps/tagcache.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/playlist.c b/apps/playlist.c index 62f85eab40..dcf2fe1118 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1353,8 +1353,8 @@ 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); + max = dircache_copy_path(playlist->filenames[index], + tmp_buf, sizeof(tmp_buf)-1); } } #else diff --git a/apps/tagcache.c b/apps/tagcache.c index 0c85fc5957..080f4198c3 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1481,10 +1481,10 @@ static bool get_next(struct tagcache_search *tcs) if (tcs->type == tag_filename && (flag & FLAG_DIRCACHE) && is_dircache_intact()) { - dircache_copy_path((struct dircache_entry *)tcs->position, + size_t len = dircache_copy_path((struct dircache_entry *)tcs->position, buf, sizeof buf); + tcs->result_len = len + 1; tcs->result = buf; - tcs->result_len = strlen(buf) + 1; tcs->ramresult = false; return true; -- cgit v1.2.3