{
char *tmpbuf;
size_t tlen;
- tlen = strlen(text);
- tmpbuf = malloc(tlen + wd->append_text_len + 1);
+ tlen = wd->append_text_position;
+ tmpbuf = malloc(wd->append_text_len + 1);
if (!tmpbuf)
{
ERR("Failed to allocate memory for entry's text %p", obj);
}
memcpy(tmpbuf, text, tlen);
if (wd->append_text_left)
- memcpy(tmpbuf + tlen, wd->append_text_left, wd->append_text_len);
- tmpbuf[tlen + wd->append_text_len] = '\0';
+ memcpy(tmpbuf + tlen, wd->append_text_left + wd->append_text_position, wd->append_text_len - tlen);
+ tmpbuf[wd->append_text_len + 1] = '\0';
eina_stringshare_replace(&wd->text, tmpbuf);
free(tmpbuf);
}