From: Max Kellermann Date: Fri, 19 Sep 2008 12:42:09 +0000 (+0200) Subject: filelist: song must not be NULL X-Git-Tag: v0.12_alpha1~226 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a2c8eb38d8b6bd615dfb9ce183730a4ebc0b6760;p=ncmpc.git filelist: song must not be NULL A caller must not pass NULL to mpdclient_filelist_find_song(). Replace the check with an assertion. --- 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;