aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-18 15:32:57 +0000
committerRoy Marples <roy@marples.name>2008-09-18 15:32:57 +0000
commit312d6f3e57aa578fb82b7d954f588a8cae35f5ef (patch)
tree5a190678c8a215118aa28ab1d451faf9e394f2b9 /src
parent39ea0cb84dd2eded881e1c77e758505dd08beb99 (diff)
Work with NULL lists.
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc-stringlist.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/librc/librc-stringlist.c b/src/librc/librc-stringlist.c
index 35889fb7..90e2af8d 100644
--- a/src/librc/librc-stringlist.c
+++ b/src/librc/librc-stringlist.c
@@ -84,9 +84,11 @@ RC_STRING *rc_stringlist_find(RC_STRINGLIST *list, const char *value)
{
RC_STRING *s;
- TAILQ_FOREACH(s, list, entries)
- if (strcmp(s->value, value) == 0)
- return s;
+ if (list) {
+ TAILQ_FOREACH(s, list, entries)
+ if (strcmp(s->value, value) == 0)
+ return s;
+ }
return NULL;
}
librc_hidden_def(rc_stringlist_find)