projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Upgrade get_vocab_id() to handle empty strings.
[open-adventure.git]
/
misc.c
diff --git
a/misc.c
b/misc.c
index 2b6a58b212a7561eab784dad1a151566319cab4f..6e3656f50fd90e9144e9f27177fc9a10673391ad 100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-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.
{
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 */
long ref_num;
/* FIXME: Magic numbers related to vocabulary */