foomatic/foomatic-mkstemp.patch

21 lines
786 B
Diff
Raw Normal View History

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
{
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)
return 0;
+ close (fd);
snprintf(filename_arg, PATH_MAX, "-sOutputFile=%s", filename);
snprintf(first_arg, 50, "-dFirstPage=%d", first);