From 4446d6da7acef007d4e6b7e3c1813a588562dda3 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 14 Jul 2022 14:33:37 +0200 Subject: WIP --- src/c_mpdview.c | 6 ++++-- 1 file 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); -- cgit v1.2.3