From ac6a319a9ddda1f9edbea077486160903b1ab8bd Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 3 Jun 2016 00:12:58 +0200 Subject: [PATCH] playlist.c - use filestream --- playlist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/playlist.c b/playlist.c index dc4d82d1fb..2000aa72db 100644 --- a/playlist.c +++ b/playlist.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "playlist.h" #include "verbosity.h" @@ -378,7 +379,7 @@ static bool playlist_read_file( char buf[PLAYLIST_ENTRIES][1024] = {{0}}; playlist_entry_t *entry = NULL; char *last = NULL; - FILE *file = fopen(path, "r"); + RFILE *file = filestream_open(path, RFILE_MODE_READ, -1); /* If playlist file does not exist, * create an empty playlist instead. @@ -392,7 +393,7 @@ static bool playlist_read_file( { *buf[i] = '\0'; - if (!fgets(buf[i], sizeof(buf[i]), file)) + if (!filestream_gets(file, buf[i], sizeof(buf[i]))) goto end; last = strrchr(buf[i], '\n'); @@ -419,7 +420,7 @@ static bool playlist_read_file( } end: - fclose(file); + filestream_close(file); return true; }