From 8578e19903b358d8d4d067812a97734736802e51 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 9 Oct 2016 09:07:53 +0200 Subject: [PATCH] playlist_read_file - prevent implicit slow memsets --- playlist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playlist.c b/playlist.c index 64d8c07eeb..dd9ec187e9 100644 --- a/playlist.c +++ b/playlist.c @@ -438,10 +438,14 @@ size_t playlist_size(playlist_t *playlist) static bool playlist_read_file( playlist_t *playlist, const char *path) { - char buf[PLAYLIST_ENTRIES][1024] = {{0}}; + unsigned i; + char buf[PLAYLIST_ENTRIES][1024]; RFILE *file = filestream_open( path, RFILE_MODE_READ_TEXT, -1); + for (i = 0; i < PLAYLIST_ENTRIES; i++) + buf[i][0] = '\0'; + /* If playlist file does not exist, * create an empty playlist instead. */