commit - 5e180e92d05844c704c9dfe3596aed85099ea647
commit + 16b32c386a9b4419fb4c16544dd03e9d57ca5a93
blob - d07eb30cb1b222a478848edaccfeefadee59a8d9
blob + fa8612c8d282e6cb2dd540f9863a76ceb13fe730
--- lib/tokenize.c
+++ lib/tokenize.c
}
free(dup);
+ if (tok == NULL)
+ return calloc(1, sizeof(char *));
return tok;
err:
blob - a2fa1f2751eaa0c92f8c65cfe384e8ed9f4f018d
blob + b991e4533263af4315924f508b2b6ece37fdc621
--- mkftsidx/wiki.c
+++ mkftsidx/wiki.c
if (r == -1)
err(1, "asprintf");
- if ((toks = tokenize(doc)) != NULL) {
- if (!dictionary_add_words(d->dict, toks, d->len-1))
- err(1, "dictionary_add_words");
- freetoks(toks);
- }
+ if ((toks = tokenize(doc)) == NULL)
+ err(1, "tokenize");
+ if (!dictionary_add_words(d->dict, toks, d->len-1))
+ err(1, "dictionary_add_words");
+ freetoks(toks);
free(doc);
free(d->title);