summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_mpdview.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/c_mpdview.c b/src/c_mpdview.c
index 7089d36..dd4f394 100644
--- a/src/c_mpdview.c
+++ b/src/c_mpdview.c
@@ -163,10 +163,12 @@ static void
c_get_current_dir(struct mpdview_s* v)
{
ptr_t ptr;
+ size_t len;
+ len = strlen(v->current_dir);
strlcpy(v->current_dir, v->music_dir, PATH_MAX);
- v->current_dir[strlen(v->current_dir) + 1] = 0x00;
- v->current_dir[strlen(v->current_dir)] = '/';
+ v->current_dir[len + 1] = 0x00;
+ v->current_dir[len] = '/';
strlcat(v->current_dir, mpd_song_get_uri(v->song), PATH_MAX);
ptr = v->current_dir;
ptr += strlen(v->current_dir);