Fix crash when compiling with -r

This fixes a crash in sc_attachdocumentation() where get_docstring()
returned an invalid string pointer because get_string() compared the
string index with list->size instead of list->length (the actual length
of the list).

Fixes #19.
This commit is contained in:
Zeex 2014-04-06 00:43:51 +07:00
parent 9744fca241
commit 2aa132d345

View File

@ -171,7 +171,7 @@ static stringlist *insert_string(stringlist *list,char *string)
static char *get_string(stringlist *list,int index)
{
assert(list!=NULL);
if (index>=0 && index<list->size)
if (index>=0 && index<list->length)
return list->strings[index];
return NULL;
}