Module Name: src
Committed By: lukem
Date: Sun Apr 12 10:31:14 UTC 2009
Modified Files:
src/usr.bin/gzip: gzip.c zuncompress.c
Log Message:
fix sign-compare issues
To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/usr.bin/gzip/gzip.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/gzip/zuncompress.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/gzip/gzip.c
diff -u src/usr.bin/gzip/gzip.c:1.93 src/usr.bin/gzip/gzip.c:1.94
--- src/usr.bin/gzip/gzip.c:1.93 Sun Aug 3 09:25:05 2008
+++ src/usr.bin/gzip/gzip.c Sun Apr 12 10:31:14 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: gzip.c,v 1.93 2008/08/03 09:25:05 skrll Exp $ */
+/* $NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $ */
/*
* Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green
@@ -30,7 +30,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\
Matthew R. Green. All rights reserved.");
-__RCSID("$NetBSD: gzip.c,v 1.93 2008/08/03 09:25:05 skrll Exp $");
+__RCSID("$NetBSD: gzip.c,v 1.94 2009/04/12 10:31:14 lukem Exp $");
#endif /* not lint */
/*
@@ -1263,7 +1263,7 @@
enum filetype method;
int fd, ofd, zfd = -1;
#ifndef SMALL
- int rv;
+ ssize_t rv;
time_t timestamp = 0;
unsigned char name[PATH_MAX + 1];
#endif
@@ -1311,7 +1311,7 @@
unsigned char ts[4]; /* timestamp */
rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
- if (rv >= 0 && rv < sizeof ts)
+ if (rv >= 0 && rv < (ssize_t)(sizeof ts))
goto unexpected_EOF;
if (rv == -1) {
if (!fflag)
Index: src/usr.bin/gzip/zuncompress.c
diff -u src/usr.bin/gzip/zuncompress.c:1.6 src/usr.bin/gzip/zuncompress.c:1.7
--- src/usr.bin/gzip/zuncompress.c:1.6 Tue Nov 22 09:05:30 2005
+++ src/usr.bin/gzip/zuncompress.c Sun Apr 12 10:31:14 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: zuncompress.c,v 1.6 2005/11/22 09:05:30 mrg Exp $ */
+/* $NetBSD: zuncompress.c,v 1.7 2009/04/12 10:31:14 lukem Exp $ */
/*-
* Copyright (c) 1985, 1986, 1992, 1993
@@ -146,7 +146,7 @@
compressed_pre = NULL;
while ((bin = fread(buf, 1, sizeof(buf), in)) != 0) {
- if (tflag == 0 && fwrite(buf, 1, bin, out) != bin) {
+ if (tflag == 0 && (off_t)fwrite(buf, 1, bin, out) != bin) {
free(buf);
return -1;
}