raster pushed a commit to branch master.

commit eb4339bb0c6e6bc461d6d05591b62c5e25456ef4
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Wed May 8 13:05:33 2013 +0900

    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.
---
 src/lib/ecore_x/xcb/ecore_xcb_selection.c | 4 ++--
 src/lib/ecore_x/xlib/ecore_x_selection.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/ecore_x/xcb/ecore_xcb_selection.c 
b/src/lib/ecore_x/xcb/ecore_xcb_selection.c
index 8be1f97..c758783 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_selection.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_selection.c
@@ -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);
diff --git a/src/lib/ecore_x/xlib/ecore_x_selection.c 
b/src/lib/ecore_x/xlib/ecore_x_selection.c
index 3c1b70c..ae2d41c 100644
--- a/src/lib/ecore_x/xlib/ecore_x_selection.c
+++ b/src/lib/ecore_x/xlib/ecore_x_selection.c
@@ -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);

-- 

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may

Reply via email to