Don't pass NULL to strncpy. (#359537, patch by Carlos Garcia Campos)
2006-11-15 Matthias Clasen <mclasen@redhat.com> * modules/printbackends/cups/gtkprintbackendcups.c (cups_printer_get_options): Don't pass NULL to strncpy. (#359537, patch by Carlos Garcia Campos)
This commit is contained in:
parent
eeff106d4e
commit
b99bea2489
@ -1,3 +1,8 @@
|
|||||||
|
2006-11-15 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* modules/printbackends/cups/gtkprintbackendcups.c (cups_printer_get_options):
|
||||||
|
Don't pass NULL to strncpy. (#359537, patch by Carlos Garcia Campos)
|
||||||
|
|
||||||
2006-11-15 Michael Natterer <mitch@imendio.com>
|
2006-11-15 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
* gtk/gtkrange.[ch]: added properties "fill-level",
|
* gtk/gtkrange.[ch]: added properties "fill-level",
|
||||||
|
@ -2196,14 +2196,27 @@ cups_printer_get_options (GtkPrinter *printer,
|
|||||||
{
|
{
|
||||||
GtkPaperSize *paper_size;
|
GtkPaperSize *paper_size;
|
||||||
ppd_option_t *option;
|
ppd_option_t *option;
|
||||||
|
const gchar *ppd_name;
|
||||||
|
|
||||||
ppdMarkDefaults (ppd_file);
|
ppdMarkDefaults (ppd_file);
|
||||||
|
|
||||||
paper_size = gtk_page_setup_get_paper_size (page_setup);
|
paper_size = gtk_page_setup_get_paper_size (page_setup);
|
||||||
|
|
||||||
option = ppdFindOption (ppd_file, "PageSize");
|
option = ppdFindOption (ppd_file, "PageSize");
|
||||||
strncpy (option->defchoice, gtk_paper_size_get_ppd_name (paper_size),
|
ppd_name = gtk_paper_size_get_ppd_name (paper_size);
|
||||||
PPD_MAX_NAME);
|
|
||||||
|
if (ppd_name)
|
||||||
|
strncpy (option->defchoice, ppd_name, PPD_MAX_NAME);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gchar *custom_name;
|
||||||
|
|
||||||
|
custom_name = g_strdup_printf (_("Custom.%2fx%.2f"),
|
||||||
|
gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS),
|
||||||
|
gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS));
|
||||||
|
strncpy (option->defchoice, custom_name, PPD_MAX_NAME);
|
||||||
|
g_free (custom_name);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < ppd_file->num_groups; i++)
|
for (i = 0; i < ppd_file->num_groups; i++)
|
||||||
handle_group (set, ppd_file, &ppd_file->groups[i], &ppd_file->groups[i], settings);
|
handle_group (set, ppd_file, &ppd_file->groups[i], &ppd_file->groups[i], settings);
|
||||||
|
Loading…
Reference in New Issue
Block a user