forked from enlightenment/efl
eina inarray accessor - use right type in parameter
this actually wasn't a bug that would cause a crash. cloning an array access would fail as the magic check would find its an accessor not an array. indeed a bug... but we never used this anywhere i can find. this was cast to the correct func ptr callabck in the accessor struct as the clone method though.. thus everyhting was happy with it seemingly. found by PVS studio @fix
This commit is contained in:
parent
33439865de
commit
091146fa34
|
@ -173,17 +173,16 @@ eina_array_accessor_free(Eina_Accessor_Array *it)
|
|||
}
|
||||
|
||||
static Eina_Accessor *
|
||||
eina_array_accessor_clone(const Eina_Array *array)
|
||||
eina_array_accessor_clone(const Eina_Accessor_Array *it)
|
||||
{
|
||||
Eina_Accessor_Array *ac;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
|
||||
EINA_MAGIC_CHECK_ARRAY(array);
|
||||
EINA_MAGIC_CHECK_ARRAY_ACCESSOR(it, NULL);
|
||||
|
||||
ac = calloc(1, sizeof (Eina_Accessor_Array));
|
||||
if (!ac) return NULL;
|
||||
|
||||
memcpy(ac, array, sizeof(Eina_Accessor_Array));
|
||||
memcpy(ac, it, sizeof(Eina_Accessor_Array));
|
||||
|
||||
return &ac->accessor;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue