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
|
2009-07-02 15:55:48 +00:00
|
|
|
{
|
2010-02-16 13:54:22 +00:00
|
|
|
char gscommand[4095];
|
2009-07-02 15:55:48 +00:00
|
|
|
char filename_arg[PATH_MAX], first_arg[50], last_arg[50];
|
2010-02-16 13:54:22 +00:00
|
|
|
+ int fd;
|
|
|
|
|
2009-07-02 15:55:48 +00:00
|
|
|
_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");
|
2009-07-02 15:55:48 +00:00
|
|
|
+ close (fd);
|
2010-02-16 13:54:22 +00:00
|
|
|
|
|
|
|
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
|
|
|
|
snprintf(first_arg, 50, "-dFirstPage=%d", first);
|