aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/song.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/song.c b/src/song.c
index 9bcb1a0b4..522d1f228 100644
--- a/src/song.c
+++ b/src/song.c
@@ -250,9 +250,11 @@ void readSongInfoIntoList(FILE * fp, SongList * list, Directory * parentDir)
song->url = xstrdup(buffer + strlen(SONG_KEY));
song->type = SONG_TYPE_FILE;
song->parentDir = parentDir;
+ } else if (*buffer == 0) {
+ /* ignore empty lines (starting with '\0') */
+ } else if (song == NULL) {
+ FATAL("Problems reading song info\n");
} else if (0 == strncmp(SONG_FILE, buffer, strlen(SONG_FILE))) {
- if (!song)
- FATAL("Problems reading song info\n");
/* we don't need this info anymore
song->url = xstrdup(&(buffer[strlen(SONG_FILE)]));
*/
@@ -270,8 +272,7 @@ void readSongInfoIntoList(FILE * fp, SongList * list, Directory * parentDir)
} else if (0 == strncmp(SONG_MTIME, buffer, strlen(SONG_MTIME))) {
song->mtime = atoi(&(buffer[strlen(SONG_MTIME)]));
}
- /* ignore empty lines (starting with '\0') */
- else if (*buffer)
+ else
FATAL("songinfo: unknown line in db: %s\n", buffer);
}