return item;
}
+static inline char *
+_strndup(const char *str, size_t len)
+{
+ size_t slen = strlen(str);
+ char *ret;
+
+ if (slen > len) slen = len;
+ ret = malloc (slen + 1);
+ if (!ret) return NULL;
+
+ if (slen > 0) memcpy(ret, str, slen);
+ ret[slen] = '\0';
+ return ret;
+}
+
static Eina_Bool
_gl_dropcb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Object_Item *it, Elm_Selection_Data *ev, int xposret EINA_UNUSED, int yposret)
{ /* This function is called when data is dropped on the genlist */
if (ev->len <= 0)
return EINA_FALSE;
- char *dd = strndup(ev->data, ev->len);
+ char *dd = _strndup(ev->data, ev->len);
if (!dd) return EINA_FALSE;
char *p = dd;
if (ev->len <= 0)
return EINA_FALSE;
- char *dd = strndup(ev->data, ev->len);
+ char *dd = _strndup(ev->data, ev->len);
if (!dd) return EINA_FALSE;
char *p = dd;
char *s = _drag_data_extract(&p);
if (ev->len <= 0)
return EINA_FALSE;
- char *dd = strndup(ev->data, ev->len);
+ char *dd = _strndup(ev->data, ev->len);
if (!dd) return EINA_FALSE;
char *p = dd;
char *s = _drag_data_extract(&p);
if (ev->len <= 0)
return EINA_FALSE;
- char *dd = strndup(ev->data, ev->len);
+ char *dd = _strndup(ev->data, ev->len);
if (!dd) return EINA_FALSE;
char *p = dd;
char *s = _drag_data_extract(&p);
if (ev->len <= 0)
return EINA_FALSE;
- char *dd = strndup(ev->data, ev->len);
+ char *dd = _strndup(ev->data, ev->len);
if (!dd) return EINA_FALSE;
char *p = dd;
char *s = _drag_data_extract(&p);