From fed719197c7014151710c4aae9174990fd131d59 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Jan 2009 19:09:34 +0100 Subject: song: allocate the result of song_get_url() --- src/song.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/song.c') diff --git a/src/song.c b/src/song.c index 9cbd859f5..b56c798cb 100644 --- a/src/song.c +++ b/src/song.c @@ -176,16 +176,14 @@ song_file_update_inarchive(struct song *song) } char * -song_get_url(const struct song *song, char *path_max_tmp) +song_get_uri(const struct song *song) { assert(song != NULL); assert(*song->url); if (!song_in_database(song) || directory_is_root(song->parent)) - strcpy(path_max_tmp, song->url); + return g_strdup(song->url); else - pfx_dir(path_max_tmp, song->url, strlen(song->url), - directory_get_path(song->parent), - strlen(directory_get_path(song->parent))); - return path_max_tmp; + return g_strconcat(directory_get_path(song->parent), + "/", song->url, NULL); } -- cgit v1.2.3