wlist.c, wl_find(), avoid crash when `string' argument is NULL

This commit is contained in:
rlar 2016-10-13 17:52:16 +02:00
parent e4e24f74e6
commit 52a1a58e14
1 changed files with 3 additions and 0 deletions

View File

@ -347,6 +347,9 @@ wl_chop_rest(wordlist *wl)
wordlist *
wl_find(const char *string, const wordlist *wl)
{
if (!string)
return NULL;
for (; wl; wl = wl->wl_next)
if (eq(string, wl->wl_word))
break;