diff options
author | Max Kellermann <max@duempel.org> | 2008-09-19 14:42:09 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-19 14:42:09 +0200 |
commit | a2c8eb38d8b6bd615dfb9ce183730a4ebc0b6760 (patch) | |
tree | 3d7d21a478c73db75b55f4b4e4f4fbaa4c8d2f56 | |
parent | b93a0bab1cfb0479c24963f649ae0de33b885289 (diff) | |
download | mpd-a2c8eb38d8b6bd615dfb9ce183730a4ebc0b6760.tar.gz mpd-a2c8eb38d8b6bd615dfb9ce183730a4ebc0b6760.tar.xz mpd-a2c8eb38d8b6bd615dfb9ce183730a4ebc0b6760.zip |
filelist: song must not be NULL
A caller must not pass NULL to mpdclient_filelist_find_song().
Replace the check with an assertion.
Diffstat (limited to '')
-rw-r--r-- | src/filelist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/filelist.c b/src/filelist.c index 6f938ea30..7b4541606 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -21,6 +21,7 @@ #include "libmpdclient.h" #include <string.h> +#include <assert.h> 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; |