summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-06-07 08:50:58 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-06-07 08:50:58 +0000
commitec7c0d185c129da1f720f64f57c70f5cdeeb7fd6 (patch)
treed0bdfe2a5c53eafbd6979d058bb1bafcca416db6
parentf08c3ad03bb0da8492c12230ba65d32787131c02 (diff)
Don't add empty strings to lists. From Thomas Parmelan
<tom@proxad.net>.
-rw-r--r--init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/init.c b/init.c
index 81b494a0..3200851a 100644
--- a/init.c
+++ b/init.c
@@ -308,6 +308,10 @@ static void add_to_list (LIST **list, const char *str)
{
LIST *t, *last = NULL;
+ /* don't add a NULL or empty string to the list */
+ if (!str || *str == '\0')
+ return;
+
/* check to make sure the item is not already on this list */
for (last = *list; last; last = last->next)
{