From b9cbcc8d0ba9ed63920ba0b7bbe1bc3fa553aeb5 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Mon, 14 May 2007 22:13:59 +0000 Subject: fix seg fault when outputing files with special printf format strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2007-05-15 Lucas Rocha * src/text.c (zenity_text_dialog_response): fix seg fault when outputing files with special printf format strings (Fixes bug #405006). Patch from Mariano Suárez-Alvarez. svn path=/trunk/; revision=1212 --- src/text.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index 1a4a322..b781682 100644 --- a/src/text.c +++ b/src/text.c @@ -159,9 +159,12 @@ zenity_text_dialog_response (GtkWidget *widget, int response, gpointer data) case GTK_RESPONSE_CLOSE: if (zen_text_data->editable) { GtkTextIter start, end; + gchar *text; gtk_text_buffer_get_bounds (zen_text_data->buffer, &start, &end); - g_print (gtk_text_buffer_get_text (zen_text_data->buffer, &start, &end, 0)); + text = gtk_text_buffer_get_text (zen_text_data->buffer, &start, &end, 0); + g_print ("%s", text); + g_free (text); } zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK); break; -- cgit v1.2.3-2-g168b