From: Florian Forster Date: Sat, 29 Mar 2008 08:57:13 +0000 (+0100) Subject: src/utils_ignorelist.c: ignorelist_match: Allow the `ignorelist' to be NULL. X-Git-Tag: collectd-4.4.0~61 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=9451dd777d3adb37e51f34a48f772e66d54b1f85 src/utils_ignorelist.c: ignorelist_match: Allow the `ignorelist' to be NULL. This makes calling the function easier, because initialization of the ignorelist in the plugin usually depends on configuration parameters.. --- diff --git a/src/utils_ignorelist.c b/src/utils_ignorelist.c index 94d6bdae..1d9467fe 100644 --- a/src/utils_ignorelist.c +++ b/src/utils_ignorelist.c @@ -1,6 +1,7 @@ /** * collectd - src/utils_ignorelist.c * Copyright (C) 2006 Lubos Stanek + * Copyright (C) 2008 Florian Forster * * This program is free software; you can redistribute it and/ * or modify it under the terms of the GNU General Public Li- @@ -19,6 +20,7 @@ * * Authors: * Lubos Stanek + * Florian Forster **/ /** * ignorelist handles plugin's list of configured collectable @@ -332,10 +334,8 @@ int ignorelist_match (ignorelist_t *il, const char *entry) { ignorelist_item_t *traverse; - assert (il != NULL); - /* if no entries, collect all */ - if (il->head == NULL) + if ((il == NULL) || (il->head == NULL)) return (0); if ((entry == NULL) || (strlen (entry) == 0))