From 8e20931f15c4ffa6d9ab5778eaf3cba9836dc13f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 5 Jul 2012 13:32:19 +0000 Subject: [PATCH] Elm entry: Fixed issues with deferred entry inserts and immediate text get. Thanks to yoz for reporting this. SVN revision: 73346 --- src/lib/elm_entry.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index b8685eb..e987b67 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -2375,7 +2375,7 @@ _elm_entry_text_get(const Evas_Object *obj, const char *item) { char *tmpbuf; size_t tlen; - tlen = wd->append_text_position; + tlen = strlen(text); tmpbuf = malloc(wd->append_text_len + 1); if (!tmpbuf) { @@ -2384,8 +2384,8 @@ _elm_entry_text_get(const Evas_Object *obj, const char *item) } memcpy(tmpbuf, text, tlen); if (wd->append_text_left) - memcpy(tmpbuf + tlen, wd->append_text_left + wd->append_text_position, wd->append_text_len - tlen); - tmpbuf[wd->append_text_len + 1] = '\0'; + memcpy(tmpbuf + tlen, wd->append_text_left + wd->append_text_position, wd->append_text_len - wd->append_text_position); + tmpbuf[wd->append_text_len] = '\0'; eina_stringshare_replace(&wd->text, tmpbuf); free(tmpbuf); } -- 2.7.4