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:
parent
9744fca241
commit
2aa132d345
@ -171,7 +171,7 @@ static stringlist *insert_string(stringlist *list,char *string)
|
|||||||
static char *get_string(stringlist *list,int index)
|
static char *get_string(stringlist *list,int index)
|
||||||
{
|
{
|
||||||
assert(list!=NULL);
|
assert(list!=NULL);
|
||||||
if (index>=0 && index<list->size)
|
if (index>=0 && index<list->length)
|
||||||
return list->strings[index];
|
return list->strings[index];
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user