From a2c8eb38d8b6bd615dfb9ce183730a4ebc0b6760 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 19 Sep 2008 14:42:09 +0200 Subject: [PATCH] filelist: song must not be NULL A caller must not pass NULL to mpdclient_filelist_find_song(). Replace the check with an assertion. --- src/filelist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/filelist.c b/src/filelist.c index 6f938ea..7b45416 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -21,6 +21,7 @@ #include "libmpdclient.h" #include +#include void mpdclient_filelist_free(struct filelist *filelist) @@ -51,7 +52,9 @@ mpdclient_filelist_find_song(struct filelist *fl, { GList *list = g_list_first(fl->list); - while (list && song) { + assert(song != NULL); + + while (list != NULL) { filelist_entry_t *entry = list->data; mpd_InfoEntity *entity = entry->entity; -- 2.30.2