From 3eea7a245a7ed49127a222628543f9509a6ff2b6 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Thu, 16 Dec 2021 17:11:12 +0100 Subject: Switched most buffers to wide chars, added general ref class, now clear mpd errors, added track and command completion --- track.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'track.c') diff --git a/track.c b/track.c index 3312daf..f7aa2a9 100644 --- a/track.c +++ b/track.c @@ -1,5 +1,6 @@ #include "track.h" +#include #include @@ -15,14 +16,10 @@ track_init(const char *dir, const char *file) ASSERT(track->fname != NULL); track->fpath = aprintf("%s/%s", dir, file); ASSERT(track->fpath != NULL); - track->name = sanitized(track->fname); - ASSERT(track->name != NULL); + track->name = calloc(strlen(track->fname) + 1, sizeof(wchar_t)); + mbstowcs(track->name, track->fname, strlen(track->fname) + 1); - // TODO track_load_info(track) - track->artist = NULL; - track->duration = 0; track->link = LINK_EMPTY; - track->tags = LIST_HEAD; return track; -- cgit v1.2.3-71-gd317