about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authormarco <marco@conformal.com>2011-09-26 10:00:18 -0500
committermarco <marco@conformal.com>2011-09-26 10:00:18 -0500
commite746aa4cca03f0f8777d7e527bebc8647dfe12c7 (patch)
tree45b16292641542da43acdf63f2def98f01d89d12
parent78d65e00f68e0c5b8beec1dc31c3988c07b98ea2 (diff)
downloadxombrero-e746aa4cca03f0f8777d7e527bebc8647dfe12c7.tar.gz
Fix a crash as pointed out in FS#129
Different fix committed but it was inspired by Cody Wright
<writecode@mailinator.com>
-rw-r--r--xxxterm.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/xxxterm.c b/xxxterm.c
index 1c3509c..616f3b1 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -2739,12 +2739,10 @@ paste_uri(struct tab *t, struct karg *args)
 	GdkAtom			atom = gdk_atom_intern("CUT_BUFFER0", FALSE);
 	gint			len;
 	gchar			*p = NULL, *uri;
-	guchar			*pp;
 
 	/* try primary clipboard first */
 	clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY);
 	p = gtk_clipboard_wait_for_text(clipboard);
-	pp = (guchar *)p;
 
 	/* if it failed get whatever text is in cut_buffer0 */
 	if (p == NULL && xterm_workaround)
@@ -2757,7 +2755,7 @@ paste_uri(struct tab *t, struct karg *args)
 		    NULL,
 		    NULL,
 		    &len,
-		    &pp)) {
+		    (guchar **)&p)) {
 			/* yes sir, we need to NUL the string */
 			p[len] = '\0';
 		}
@@ -9472,7 +9470,6 @@ void
 clipb_primary_cb(GtkClipboard *primary, GdkEvent *event, gpointer notused)
 {
 	gchar			*p = NULL;
-	guchar			*pp;
 	GdkAtom			atom = gdk_atom_intern("CUT_BUFFER0", FALSE);
 	gint			len;
 
@@ -9488,8 +9485,6 @@ clipb_primary_cb(GtkClipboard *primary, GdkEvent *event, gpointer notused)
 	 */
 
 	p = gtk_clipboard_wait_for_text(primary);
-	pp = (guchar *)p;
-
 	if (p == NULL) {
 		if (gdk_property_get(gdk_get_default_root_window(),
 		    atom,
@@ -9500,7 +9495,7 @@ clipb_primary_cb(GtkClipboard *primary, GdkEvent *event, gpointer notused)
 		    NULL,
 		    NULL,
 		    &len,
-		    &pp)) {
+		    (guchar **)&p)) {
 			/* yes sir, we need to NUL the string */
 			p[len] = '\0';
 			gtk_clipboard_set_text(primary, p, -1);