]> Pileus Git - ~andy/gtk/commitdiff
Bug 534869 – Length miscalculation in
authorRichard Hult <richard@imendio.com>
Mon, 26 May 2008 07:40:17 +0000 (07:40 +0000)
committerRichard Hult <rhult@src.gnome.org>
Mon, 26 May 2008 07:40:17 +0000 (07:40 +0000)
2008-05-26  Richard Hult  <richard@imendio.com>

Bug 534869 – Length miscalculation in
_gtk_quartz_get_selection_data_from_pasteboard

* gtk/gtkquartz.c: (_gtk_quartz_get_selection_data_from_pasteboard):
Get the number of bytes, not the number of characters, patch from
Yevgen Muntyan.

svn path=/trunk/; revision=20174

ChangeLog
gtk/gtkquartz.c

index 9ced461bf7ccaf2ebb8d93ee3a555dcd290f6b18..bf3b70b8c7bc8bc5dac7d77f581b3387408eb00e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-05-26  Richard Hult  <richard@imendio.com>
+
+       Bug 534869 – Length miscalculation in
+       _gtk_quartz_get_selection_data_from_pasteboard
+
+       * gtk/gtkquartz.c: (_gtk_quartz_get_selection_data_from_pasteboard):
+       Get the number of bytes, not the number of characters, patch from
+       Yevgen Muntyan.
+
 2008-05-26  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwidget.c: Some doc formatting fixes.
index 859d3810fa39aea21a09a9aefa36f3536e0bed97..8f4b9932d7bac5f392c59cd8bc8fc0e2953019e6 100644 (file)
@@ -166,12 +166,12 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
 
       if (s)
        {
-          int len = [s length];
+          const char *utf8_string = [s UTF8String];
 
           selection_data->type = target;
          selection_data->format = 8;
-         selection_data->length = len;
-         selection_data->data = g_memdup ([s UTF8String], len + 1);
+         selection_data->length = strlen (utf8_string);
+         selection_data->data = (guchar*) g_strdup (utf8_string);
        }
     }
   else if (target == gdk_atom_intern_static_string ("application/x-color"))