aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/playlist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 60ad75627..1196db703 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -272,7 +272,10 @@ static void loadPlaylistFromStateFile(FILE *fp, char *buffer,
if (!myFgets(buffer, PLAYLIST_BUFFER_SIZE, fp))
state_file_fatal();
while (strcmp(buffer, PLAYLIST_STATE_FILE_PLAYLIST_END)) {
- song = atoi(strtok(buffer, ":"));
+ temp = strtok(buffer, ":");
+ if (temp == NULL)
+ state_file_fatal();
+ song = atoi(temp);
if (!(temp = strtok(NULL, "")))
state_file_fatal();
if (!addToPlaylist(STDERR_FILENO, temp, NULL)