From: Andreas Liebe Date: Sat, 25 Jul 2009 00:21:59 +0000 (+0400) Subject: [print] Fixes segmentation violation when format is empty X-Git-Tag: EVINCE_2_27_90~23 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=cc3f21efc8104182171c9300facc16d9a79177ef;p=evince.git [print] Fixes segmentation violation when format is empty Where the printf functions do not accept NULL for %s. Fixes GNOME bug #589226. --- diff --git a/shell/ev-print-operation.c b/shell/ev-print-operation.c index efb00a93..4e78c3f0 100644 --- a/shell/ev-print-operation.c +++ b/shell/ev-print-operation.c @@ -1148,7 +1148,7 @@ ev_print_operation_export_print_dialog_response_cb (GtkDialog *dial file_format = gtk_print_settings_get (print_settings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT); - filename = g_strdup_printf ("evince_print.%s.XXXXXX", file_format); + filename = g_strdup_printf ("evince_print.%s.XXXXXX", file_format != NULL ? file_format : ""); export->fd = g_file_open_tmp (filename, &export->temp_file, &error); g_free (filename); if (export->fd <= -1) {