2010-02-16 10:38:40 +00:00
|
|
|
diff -up foomatic-filters-4.0.4/pdf.c.mkstemp foomatic-4.0.4/foomatic-filters-4.0.4/pdf.c
|
|
|
|
--- foomatic-filters-4.0.4/pdf.c.mkstemp 2010-02-15 13:57:40.000000000 +0100
|
|
|
|
+++ foomatic-filters-4.0.4/pdf.c 2010-02-15 17:58:11.000000000 +0100
|
|
|
|
@@ -112,13 +112,14 @@ static int pdf_extract_pages(char filena
|
2009-07-02 15:55:48 +00:00
|
|
|
{
|
2010-02-16 10:38:40 +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 10:38:40 +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)
|
|
|
|
return 0;
|
|
|
|
+ close (fd);
|
2010-02-16 10:38:40 +00:00
|
|
|
|
|
|
|
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
|
|
|
|
snprintf(first_arg, 50, "-dFirstPage=%d", first);
|