aboutsummaryrefslogtreecommitdiffstats
path: root/src/song_save.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/song_save.c')
-rw-r--r--src/song_save.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/song_save.c b/src/song_save.c
index 41e694611..ff5aeb1a7 100644
--- a/src/song_save.c
+++ b/src/song_save.c
@@ -104,11 +104,13 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
struct directory *parent)
{
char buffer[MPD_PATH_MAX + 1024];
- int bufferSize = MPD_PATH_MAX + 1024;
struct song *song = NULL;
int itemType;
- while (myFgets(buffer, bufferSize, fp) && 0 != strcmp(SONG_END, buffer)) {
+ while (fgets(buffer, sizeof(buffer), fp) &&
+ !g_str_has_prefix(buffer, SONG_END)) {
+ g_strchomp(buffer);
+
if (0 == strncmp(SONG_KEY, buffer, strlen(SONG_KEY))) {
if (song)
insertSongIntoList(sv, song);