summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorbfriesen <bfriesen>2015-09-06 18:24:27 +0000
committerbfriesen <bfriesen>2015-09-06 18:24:27 +0000
commitc191c026a49f966a13ac35ba019403ea9e011a2c (patch)
treeb8d38c6fb646b13fe6c57fd891200a543ea6146c /tools
parent1333534e784de39a0f14688982d86d07694546f6 (diff)
downloadlibtiff-c191c026a49f966a13ac35ba019403ea9e011a2c.tar.gz
* 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.
Diffstat (limited to 'tools')
-rw-r--r--tools/fax2ps.c12
-rw-r--r--tools/tiff2pdf.c6
2 files changed, 14 insertions, 4 deletions
diff --git a/tools/fax2ps.c b/tools/fax2ps.c
index d565f80c..c4953315 100644
--- a/tools/fax2ps.c
+++ b/tools/fax2ps.c
@@ -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");
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index 14b16b1c..00bf8508 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -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)