ecore_x: '\0' terminate converted text

This makes ecore_x text converter behave like elm text converter.

Fixes CID 1039310
This commit is contained in:
Sebastian Dransfeld 2013-12-07 17:14:11 +01:00
parent 50feb1f8da
commit 04e0a6d95e
1 changed files with 2 additions and 1 deletions

View File

@ -599,12 +599,13 @@ ecore_x_selection_converter_text(char *target,
&text_prop) == Success)
{
int bufsize = strlen((char *)text_prop.value);
*data_ret = malloc(bufsize);
*data_ret = malloc(bufsize + 1);
if (!*data_ret)
{
return EINA_FALSE;
}
memcpy(*data_ret, text_prop.value, bufsize);
((char **)data_ret)[bufsize] = 0;
*size_ret = bufsize;
XFree(text_prop.value);
return EINA_TRUE;