get rid of trailing nul byte in selections for x11

not noticed until recently.. we add a nul byte to the end of our text
selections that we shouldnt. most toolkits/apps skip it but some..
like emacs... dont.
This commit is contained in:
Carsten Haitzler 2013-05-08 13:05:33 +09:00
parent f71b40db2f
commit eb4339bb0c
2 changed files with 4 additions and 4 deletions

View File

@ -706,7 +706,7 @@ ecore_x_selection_converter_text(char *target,
{
int size = 0;
size = (strlen((char *)ret.value) + 1);
size = (strlen((char *)ret.value));
*data_ret = malloc(size);
if (!*data_ret) return EINA_FALSE;
memcpy(*data_ret, ret.value, size);
@ -719,7 +719,7 @@ ecore_x_selection_converter_text(char *target,
{
int size = 0;
size = (strlen((char *)ret.value) + 1);
size = (strlen((char *)ret.value));
*data_ret = malloc(size);
if (!*data_ret) return EINA_FALSE;
memcpy(*data_ret, ret.value, size);

View File

@ -624,7 +624,7 @@ ecore_x_selection_converter_text(char *target,
if (Xutf8TextListToTextProperty(_ecore_x_disp, &mystr, 1, style,
&text_prop) == Success)
{
int bufsize = strlen((char *)text_prop.value) + 1;
int bufsize = strlen((char *)text_prop.value);
*data_ret = malloc(bufsize);
if (!*data_ret)
{
@ -640,7 +640,7 @@ ecore_x_selection_converter_text(char *target,
if (XmbTextListToTextProperty(_ecore_x_disp, &mystr, 1, style,
&text_prop) == Success)
{
int bufsize = strlen(text_prop.value) + 1;
int bufsize = strlen(text_prop.value);
*data_ret = malloc(bufsize);
if (!*data_ret) return EINA_FALSE;
memcpy(*data_ret, text_prop.value, bufsize);