gtk+ r20174 - in trunk: . gtk



Author: rhult
Date: Mon May 26 07:40:17 2008
New Revision: 20174
URL: http://svn.gnome.org/viewvc/gtk+?rev=20174&view=rev

Log:
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.


Modified:
   trunk/ChangeLog
   trunk/gtk/gtkquartz.c

Modified: trunk/gtk/gtkquartz.c
==============================================================================
--- trunk/gtk/gtkquartz.c	(original)
+++ trunk/gtk/gtkquartz.c	Mon May 26 07:40:17 2008
@@ -166,12 +166,12 @@
 
       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"))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]