diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2001-06-07 08:50:58 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2001-06-07 08:50:58 +0000 |
commit | ec7c0d185c129da1f720f64f57c70f5cdeeb7fd6 (patch) | |
tree | d0bdfe2a5c53eafbd6979d058bb1bafcca416db6 | |
parent | f08c3ad03bb0da8492c12230ba65d32787131c02 (diff) |
Don't add empty strings to lists. From Thomas Parmelan
<tom@proxad.net>.
-rw-r--r-- | init.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) { |