summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Rocha <lucasr@gnome.org>2007-05-14 22:13:59 +0000
committerLucas Almeida Rocha <lucasr@src.gnome.org>2007-05-14 22:13:59 +0000
commitb9cbcc8d0ba9ed63920ba0b7bbe1bc3fa553aeb5 (patch)
treed848ad3454bf310136bce35bd7ac5d989980ddf6
parentfix index handling for --print-column (Fixes bug #420396). (diff)
downloadzenity-b9cbcc8d0ba9ed63920ba0b7bbe1bc3fa553aeb5.tar.gz
zenity-b9cbcc8d0ba9ed63920ba0b7bbe1bc3fa553aeb5.tar.bz2
zenity-b9cbcc8d0ba9ed63920ba0b7bbe1bc3fa553aeb5.zip
fix seg fault when outputing files with special printf format strings
2007-05-15 Lucas Rocha <lucasr@gnome.org> * 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
-rw-r--r--ChangeLog6
-rw-r--r--src/text.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d0373f4..2d551d79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2007-05-15 Lucas Rocha <lucasr@gnome.org>
+ * 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.
+
+2007-05-15 Lucas Rocha <lucasr@gnome.org>
+
* src/tree.c (zenity_tree_dialog_toggle_get_selected): fix index
handling for --print-column (Fixes bug #420396).
diff --git a/src/text.c b/src/text.c
index 1a4a3227..b7816826 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;
bgstack15