Commit 017e5ef7 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

no need to set strlen(sting)+1 bytes on the GtkSelectionData because

2008-09-02  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpselectiondata.c: no need to set strlen(sting)+1
	bytes on the GtkSelectionData because gtk_selection_data_set()
	zero-terminates all data anyway.


svn path=/trunk/; revision=26835
parent 641dbb65
2008-09-02 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpselectiondata.c: no need to set strlen(sting)+1
bytes on the GtkSelectionData because gtk_selection_data_set()
zero-terminates all data anyway.
2008-09-02 Michael Natterer <mitch@gimp.org> 2008-09-02 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpselectiondata.c (gimp_selection_data_get_name): * app/widgets/gimpselectiondata.c (gimp_selection_data_get_name):
......
...@@ -93,7 +93,7 @@ gimp_selection_data_set_uri_list (GtkSelectionData *selection, ...@@ -93,7 +93,7 @@ gimp_selection_data_set_uri_list (GtkSelectionData *selection,
} }
gtk_selection_data_set (selection, selection->target, gtk_selection_data_set (selection, selection->target,
8, (guchar *) vals, strlen (vals) + 1); 8, (guchar *) vals, strlen (vals));
g_free (vals); g_free (vals);
} }
...@@ -361,7 +361,7 @@ gimp_selection_data_set_image (GtkSelectionData *selection, ...@@ -361,7 +361,7 @@ gimp_selection_data_set_image (GtkSelectionData *selection,
str = g_strdup_printf ("%d:%d", get_pid (), gimp_image_get_ID (image)); str = g_strdup_printf ("%d:%d", get_pid (), gimp_image_get_ID (image));
gtk_selection_data_set (selection, selection->target, gtk_selection_data_set (selection, selection->target,
8, (guchar *) str, strlen (str) + 1); 8, (guchar *) str, strlen (str));
g_free (str); g_free (str);
} }
...@@ -406,7 +406,7 @@ gimp_selection_data_set_component (GtkSelectionData *selection, ...@@ -406,7 +406,7 @@ gimp_selection_data_set_component (GtkSelectionData *selection,
(gint) channel); (gint) channel);
gtk_selection_data_set (selection, selection->target, gtk_selection_data_set (selection, selection->target,
8, (guchar *) str, strlen (str) + 1); 8, (guchar *) str, strlen (str));
g_free (str); g_free (str);
} }
...@@ -459,7 +459,7 @@ gimp_selection_data_set_item (GtkSelectionData *selection, ...@@ -459,7 +459,7 @@ gimp_selection_data_set_item (GtkSelectionData *selection,
str = g_strdup_printf ("%d:%d", get_pid (), gimp_item_get_ID (item)); str = g_strdup_printf ("%d:%d", get_pid (), gimp_item_get_ID (item));
gtk_selection_data_set (selection, selection->target, gtk_selection_data_set (selection, selection->target,
8, (guchar *) str, strlen (str) + 1); 8, (guchar *) str, strlen (str));
g_free (str); g_free (str);
} }
...@@ -506,8 +506,10 @@ gimp_selection_data_set_object (GtkSelectionData *selection, ...@@ -506,8 +506,10 @@ gimp_selection_data_set_object (GtkSelectionData *selection,
gchar *str; gchar *str;
str = g_strdup_printf ("%d:%p:%s", get_pid (), object, name); str = g_strdup_printf ("%d:%p:%s", get_pid (), object, name);
gtk_selection_data_set (selection, selection->target, gtk_selection_data_set (selection, selection->target,
8, (guchar *) str, strlen (str) + 1); 8, (guchar *) str, strlen (str));
g_free (str); g_free (str);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment