* tools/tiff2pdf.c: Fix compiler warning about unused function

when JPEG is not available.

* tools/fax2ps.c (main): Detect failure to write to temporary
file.
This commit is contained in:
Bob Friesenhahn 2015-09-06 18:24:27 +00:00
parent 2c7bbbc163
commit 7bc7b77e78
3 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2015-09-06 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* tools/tiff2pdf.c: Fix compiler warning about unused function
when JPEG is not available.
* tools/fax2ps.c (main): Detect failure to write to temporary
file.
2015-09-05 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* libtiff/tif_dirread.c (TIFFReadDirEntryCheckRangeSlongSlong8):

View File

@ -1,4 +1,4 @@
/* $Id: fax2ps.c,v 1.30 2015-08-19 02:31:04 bfriesen Exp $" */
/* $Id: fax2ps.c,v 1.31 2015-09-06 18:24:27 bfriesen Exp $" */
/*
* Copyright (c) 1991-1997 Sam Leffler
@ -398,8 +398,14 @@ main(int argc, char** argv)
#if defined(HAVE_SETMODE) && defined(O_BINARY)
setmode(fileno(stdin), O_BINARY);
#endif
while ((n = read(fileno(stdin), buf, sizeof (buf))) > 0)
write(fileno(fd), buf, n);
while ((n = read(fileno(stdin), buf, sizeof (buf))) > 0) {
if (write(fileno(fd), buf, n) != n) {
fclose(fd);
fprintf(stderr,
"Could not copy stdin to temporary file.\n");
exit(-2);
}
}
_TIFF_lseek_f(fileno(fd), 0, SEEK_SET);
#if defined(_WIN32) && defined(USE_WIN32_FILEIO)
tif = TIFFFdOpen(_get_osfhandle(fileno(fd)), "temp", "r");

View File

@ -1,4 +1,4 @@
/* $Id: tiff2pdf.c,v 1.90 2015-08-19 02:31:04 bfriesen Exp $
/* $Id: tiff2pdf.c,v 1.91 2015-09-06 18:24:27 bfriesen Exp $
*
* tiff2pdf - converts a TIFF image to a PDF document
*
@ -358,6 +358,7 @@ t2p_enable(TIFF *tif)
* Procs for TIFFClientOpen
*/
#ifdef OJPEG_SUPPORT
static tmsize_t
t2pReadFile(TIFF *tif, tdata_t data, tmsize_t size)
{
@ -367,6 +368,7 @@ t2pReadFile(TIFF *tif, tdata_t data, tmsize_t size)
return proc(client, data, size);
return -1;
}
#endif /* OJPEG_SUPPORT */
static tmsize_t
t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
@ -443,6 +445,7 @@ t2p_unmapproc(thandle_t handle, void *data, toff_t offset)
(void) handle, (void) data, (void) offset;
}
#if defined(OJPEG_SUPPORT) || defined(JPEG_SUPPORT)
static uint64
checkAdd64(uint64 summand1, uint64 summand2, T2P* t2p)
{
@ -456,6 +459,7 @@ checkAdd64(uint64 summand1, uint64 summand2, T2P* t2p)
return bytes;
}
#endif /* defined(OJPEG_SUPPORT) || defined(JPEG_SUPPORT) */
static uint64
checkMultiply64(uint64 first, uint64 second, T2P* t2p)