foomatic/foomatic-mkstemp.patch

21 lines
822 B
Diff
Raw Normal View History

2010-08-18 12:44:33 +00:00
diff -up foomatic-filters-4.0.5/pdf.c.mkstemp foomatic-filters-4.0.5/pdf.c
--- foomatic-filters-4.0.5/pdf.c.mkstemp 2010-08-10 12:08:04.000000000 +0200
+++ foomatic-filters-4.0.5/pdf.c 2010-08-18 12:34:11.000000000 +0200
@@ -110,13 +110,14 @@ static int pdf_extract_pages(char filena
{
char gscommand[4095];
char filename_arg[PATH_MAX], first_arg[50], last_arg[50];
+ int fd;
_log("Extracting pages %d through %d\n", first, last);
snprintf(filename, PATH_MAX, "%s/foomatic-XXXXXX", temp_dir());
- mktemp(filename);
- if (!filename[0])
+ if ((fd = mkstemp(filename)) == -1)
2010-08-18 12:44:33 +00:00
rip_die(EXIT_STARVED, "Unable to create temporary file!\n");
+ close (fd);
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
snprintf(first_arg, 50, "-dFirstPage=%d", first);