|
@@ -1636,7 +1636,7 @@ sp_entity_t *sp_mod_find_entity_by_name(sp_mod_t *mod, const char *entity_name)
|
|
|
|
|
|
sp_entity_t *sp_mod_find_entity_by_idx(sp_mod_t *mod, int entity_idx)
|
|
|
{
|
|
|
- if (entity_idx == -1 || entity_idx >= mod->mgr->arr_ent->nelts)
|
|
|
+ if (entity_idx == -1 || entity_idx > mod->mgr->arr_ent->nelts)
|
|
|
return NULL;
|
|
|
|
|
|
return ARRAY_IDX(mod->mgr->arr_ent, entity_idx, sp_entity_t*);
|