foomatic/foomatic-mkstemp.patch
Tim Waugh 4c4d5cdedc - Updated db-engine to 4.0.2 (bug #503188).
- Updated foomatic-filters to 4.0.2 (bug #496521).
- Updated db-hpijs to 20090701.
- Updated db to 4.0-20090702.
- This package obsoletes oki4linux (bug #491489).
- Don't ship ChangeLog/README/USAGE for each of the 4 packages as it comes
    to more than 1MB (bug #492449).
- Don't use mktemp in foomatic-rip.
2009-07-02 15:55:48 +00:00

25 lines
989 B
Diff

diff -up foomatic-filters-4.0.2/pdf.c.mkstemp foomatic-filters-4.0.2/pdf.c
--- foomatic-filters-4.0.2/pdf.c.mkstemp 2009-07-02 15:52:38.960401425 +0100
+++ foomatic-filters-4.0.2/pdf.c 2009-07-02 16:24:39.966400563 +0100
@@ -157,6 +157,7 @@ static int pdf_extract_pages(char filena
int last)
{
void *minst;
+ int fd;
char filename_arg[PATH_MAX], first_arg[50], last_arg[50];
const char *gs_args[] = { "", "-q", "-dNOPAUSE", "-dBATCH",
"-dPARANOIDSAFER", "-sDEVICE=pdfwrite", filename_arg, first_arg,
@@ -165,10 +166,10 @@ static int pdf_extract_pages(char filena
_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);
if (gsapi_new_instance(&minst, NULL) < 0)
{
_log("Could not create ghostscript instance\n");