summaryrefslogtreecommitdiff
path: root/tools/raw2tiff.c
diff options
context:
space:
mode:
authorAndrey Kiselev <dron@ak4719.spb.edu>2004-11-28 14:44:31 +0000
committerAndrey Kiselev <dron@ak4719.spb.edu>2004-11-28 14:44:31 +0000
commit7f8e2255009250e481bc2770a15b6738b6a883a5 (patch)
tree3caafba37f4817e8b2b9855fcd7eda587e582c0d /tools/raw2tiff.c
parenta482a40a41a6401f53ed33f01f8d1482a051a287 (diff)
downloadlibtiff-git-7f8e2255009250e481bc2770a15b6738b6a883a5.tar.gz
Avoid warnings.
Diffstat (limited to 'tools/raw2tiff.c')
-rw-r--r--tools/raw2tiff.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/raw2tiff.c b/tools/raw2tiff.c
index a75fd5fa..f5e8b4f9 100644
--- a/tools/raw2tiff.c
+++ b/tools/raw2tiff.c
@@ -1,4 +1,4 @@
-/* $Id: raw2tiff.c,v 1.16 2004-10-28 14:35:50 dron Exp $
+/* $Id: raw2tiff.c,v 1.17 2004-11-28 14:44:31 dron Exp $
*
* Project: libtiff tools
* Purpose: Convert raw byte sequences in TIFF images
@@ -55,6 +55,10 @@
#include "tiffio.h"
+#ifndef HAVE_GETOPT
+extern int getopt(int, char**, char*);
+#endif
+
#ifndef O_BINARY
# define O_BINARY 0
#endif
@@ -276,7 +280,7 @@ main(int argc, char* argv[])
lseek(fd,
hdr_size + (length*band+row)*linebytes,
SEEK_SET);
- if (read(fd, buf, linebytes) != linebytes) {
+ if (read(fd, buf, linebytes) < 0) {
fprintf(stderr,
"%s: %s: scanline %lu: Read error.\n",
argv[0], argv[optind],
@@ -292,7 +296,7 @@ main(int argc, char* argv[])
break;
case PIXEL: /* pixel interleaved data */
default:
- if (read(fd, buf1, bufsize) != bufsize) {
+ if (read(fd, buf1, bufsize) < 0) {
fprintf(stderr,
"%s: %s: scanline %lu: Read error.\n",
argv[0], argv[optind],
@@ -415,7 +419,7 @@ guessSize(int fd, TIFFDataType dtype, off_t hdr_size, uint32 nbands,
return 1;
} else {
- if (filestat.st_size<hdr_size+(*width)*(*length)*nbands*depth) {
+ if (filestat.st_size<(off_t)(hdr_size+(*width)*(*length)*nbands*depth)) {
fprintf(stderr, "Input file too small.\n");
return -1;
}