diff options
author | Didier Raboud <odyx@debian.org> | 2011-08-02 17:57:51 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2011-08-02 17:57:51 +0200 |
commit | 4f12cad09dee21cc2434689f63e0d3eb9aa29eb2 (patch) | |
tree | 1fee90b805e5f64080676d2562844f46e5d02536 /pdf.c | |
parent | b9ea2e219660b6e432633ef748309d7d4902945f (diff) | |
parent | 8010f81b0350b5c4beafc260171c18f3852d4f7f (diff) |
Merge commit 'upstream/4.0.8'
Diffstat (limited to 'pdf.c')
-rw-r--r-- | pdf.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -110,13 +110,14 @@ static int pdf_extract_pages(char filename[PATH_MAX], { 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) 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); @@ -125,7 +126,7 @@ static int pdf_extract_pages(char filename[PATH_MAX], else first_arg[0] = '\0'; - snprintf(gscommand, 4095, "%s -q -dNOPAUSE -dBATCH -dPARANOIDSAFER" + snprintf(gscommand, 4095, "%s -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -dNOINTERPOLATE" "-sDEVICE=pdfwrite %s %s %s %s", gspath, filename_arg, first_arg, last_arg, pdffilename); |