]> www.fi.muni.cz Git - evince.git/commitdiff
[print] Fixes segmentation violation when format is empty
authorAndreas Liebe <liebe@hrz.tu-darmstadt.de>
Sat, 25 Jul 2009 00:21:59 +0000 (04:21 +0400)
committerNickolay V. Shmyrev <nshmyrev@yandex.ru>
Sat, 25 Jul 2009 00:21:59 +0000 (04:21 +0400)
Where the printf functions do not accept NULL for %s. Fixes GNOME bug #589226.

shell/ev-print-operation.c

index efb00a93292c751892af75f82d975785b42d1c21..4e78c3f050ee7a02cc6ef29f3746b1f5c5a074dc 100644 (file)
@@ -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) {