summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-28 19:54:13 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-29 08:55:27 +0900
commit091146fa34c4e7616375a67773c8e143af1d1674 (patch)
treeb483baf0d5135a0e1b838a5af26f7416ec912656
parent33439865de327c5bac1c9a531070514e63fe3a04 (diff)
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
-rw-r--r--src/lib/eina/eina_array.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/eina/eina_array.c b/src/lib/eina/eina_array.c
index 99891adcc5..e439450021 100644
--- a/src/lib/eina/eina_array.c
+++ b/src/lib/eina/eina_array.c
@@ -173,17 +173,16 @@ eina_array_accessor_free(Eina_Accessor_Array *it)
173} 173}
174 174
175static Eina_Accessor * 175static Eina_Accessor *
176eina_array_accessor_clone(const Eina_Array *array) 176eina_array_accessor_clone(const Eina_Accessor_Array *it)
177{ 177{
178 Eina_Accessor_Array *ac; 178 Eina_Accessor_Array *ac;
179 179
180 EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL); 180 EINA_MAGIC_CHECK_ARRAY_ACCESSOR(it, NULL);
181 EINA_MAGIC_CHECK_ARRAY(array);
182 181
183 ac = calloc(1, sizeof (Eina_Accessor_Array)); 182 ac = calloc(1, sizeof (Eina_Accessor_Array));
184 if (!ac) return NULL; 183 if (!ac) return NULL;
185 184
186 memcpy(ac, array, sizeof(Eina_Accessor_Array)); 185 memcpy(ac, it, sizeof(Eina_Accessor_Array));
187 186
188 return &ac->accessor; 187 return &ac->accessor;
189} 188}