aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/directory.c2
-rw-r--r--src/song.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/directory.c b/src/directory.c
index d0ea403d0..7bd9b9f61 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -250,7 +250,7 @@ Directory * newDirectory(char * dirname, Directory * parent) {
directory = malloc(sizeof(Directory));
- if(dirname!=NULL) directory->path = strdup(dirname);
+ if(dirname && strlen(dirname)) directory->path = strdup(dirname);
else directory->path = NULL;
directory->subDirectories = newDirectoryList();
directory->songs = newSongList();
diff --git a/src/song.c b/src/song.c
index 14e4ff9b7..a54c71735 100644
--- a/src/song.c
+++ b/src/song.c
@@ -118,7 +118,7 @@ void freeSongList(SongList * list) {
}
void printSongUrl(FILE * fp, Song * song) {
- if(song->parentDir) {
+ if(song->parentDir && song->parentDir->path) {
myfprintf(fp, "%s%s/%s\n", SONG_FILE,
getDirectoryPath(song->parentDir), song->url);
}