diff options
author | Max Kellermann <max@duempel.org> | 2008-12-28 19:54:49 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-12-28 19:54:49 +0100 |
commit | 859aac7242fe3767c19c1bfff73d5e6159cbad31 (patch) | |
tree | 2e433f6ec1a820d99ad171ffd6a49a6828ddd0e4 /src/song_save.c | |
parent | 2598cdd86814c7792a431470a9143d609399697b (diff) | |
download | mpd-859aac7242fe3767c19c1bfff73d5e6159cbad31.tar.gz mpd-859aac7242fe3767c19c1bfff73d5e6159cbad31.tar.xz mpd-859aac7242fe3767c19c1bfff73d5e6159cbad31.zip |
utils: removed myFgets()
Replaced myFgets() with fgets() + g_strchomp().
Diffstat (limited to '')
-rw-r--r-- | src/song_save.c | 6 |
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); |