Upgrade get_vocab_id() to handle empty strings.

This commit is contained in:
Jason S. Ninneman 2017-07-03 10:37:44 -07:00
parent 659f797d8a
commit 07e7b8131e
2 changed files with 5 additions and 0 deletions

4
misc.c
View file

@ -483,6 +483,10 @@ int get_special_vocab_id(const char* word)
long get_vocab_id(const char* word)
// Search the vocab categories in order for the supplied word.
{
/* Check for an empty string */
if (strncmp(word, "", sizeof("")) == 0)
return (WORD_EMPTY);
long ref_num;
/* FIXME: Magic numbers related to vocabulary */