aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_save.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 19:09:34 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 19:09:34 +0100
commitfed719197c7014151710c4aae9174990fd131d59 (patch)
tree0fb6d6f69aa60ecdf9eb89286f8354316fffcc92 /src/playlist_save.c
parentea8ae68e6f1a686fd96530fdaf7b428e33f58ec4 (diff)
downloadmpd-fed719197c7014151710c4aae9174990fd131d59.tar.gz
mpd-fed719197c7014151710c4aae9174990fd131d59.tar.xz
mpd-fed719197c7014151710c4aae9174990fd131d59.zip
song: allocate the result of song_get_url()
Diffstat (limited to '')
-rw-r--r--src/playlist_save.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/playlist_save.c b/src/playlist_save.c
index dbe389a96..054ba73f4 100644
--- a/src/playlist_save.c
+++ b/src/playlist_save.c
@@ -29,8 +29,6 @@
void
playlist_print_song(FILE *file, const struct song *song)
{
- char tmp1[MPD_PATH_MAX], tmp2[MPD_PATH_MAX];
-
if (playlist_saveAbsolutePaths && song_in_database(song)) {
char *path = map_song_fs(song);
if (path != NULL) {
@@ -38,9 +36,13 @@ playlist_print_song(FILE *file, const struct song *song)
g_free(path);
}
} else {
- song_get_url(song, tmp1);
- utf8_to_fs_charset(tmp2, tmp1);
- fprintf(file, "%s\n", tmp2);
+ char *uri = song_get_uri(song);
+ char tmp2[MPD_PATH_MAX];
+
+ utf8_to_fs_charset(tmp2, uri);
+ g_free(uri);
+
+ fprintf(file, "%s\n", uri);
}
}