elementary/cnp - [E-devel] [Patch] elm_cnp notify_handler patch

When pasting data to entry, notify_handler_text sent incorrect string. 

Because notify_handler_text received string including garbage value.

I cut string as its data length.

Signed-By-Off: Minseok Kim <minseok3.kim@samsung.com>



SVN revision: 69942
This commit is contained in:
ChunEon Park 2012-04-06 05:58:50 +00:00
parent 676712d8a6
commit 4a0a6b6362
1 changed files with 7 additions and 2 deletions

View File

@ -775,8 +775,12 @@ notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
{
Ecore_X_Selection_Data *data;
char *str;
char *mkupstr;
data = notify->data;
str = malloc(sizeof(char) * (data->length + 1));
strncpy(str, (char *)data->data, data->length);
str[data->length] = '\0';
if (sel->datacb)
{
@ -791,10 +795,11 @@ notify_handler_text(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
}
cnp_debug("Notify handler text %d %d %p\n", data->format,data->length, data->data);
str = _elm_util_text_to_mkup((const char *) data->data);
mkupstr = _elm_util_text_to_mkup((const char *) str);
cnp_debug("String is %s (from %s)\n", str, data->data);
_elm_entry_entry_paste(sel->requestwidget, str);
_elm_entry_entry_paste(sel->requestwidget, mkupstr);
free(str);
free(mkupstr);
return 0;
}