diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c index c4ddb2da38d5..9244d3e96244 100644 --- a/usr.bin/gzip/gzip.c +++ b/usr.bin/gzip/gzip.c @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.71 2005/02/22 21:45:44 yamt Exp $ */ +/* $NetBSD: gzip.c,v 1.72 2005/06/02 01:51:58 lukem Exp $ */ /* * Copyright (c) 1997, 1998, 2003, 2004 Matthew R. Green @@ -32,7 +32,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004 Matthew R. Green\n\ All rights reserved.\n"); -__RCSID("$NetBSD: gzip.c,v 1.71 2005/02/22 21:45:44 yamt Exp $"); +__RCSID("$NetBSD: gzip.c,v 1.72 2005/06/02 01:51:58 lukem Exp $"); #endif /* not lint */ /* @@ -664,8 +664,8 @@ gz_uncompress(int in, int out, char *pre, size_t prelen, off_t *gsizep, { z_stream z; char *outbufp, *inbufp; - off_t out_tot, in_tot; - uint32_t out_sub_tot; + off_t out_tot = -1, in_tot = 0; + uint32_t out_sub_tot = 0; enum { GZSTATE_MAGIC0, GZSTATE_MAGIC1, @@ -685,8 +685,8 @@ gz_uncompress(int in, int out, char *pre, size_t prelen, off_t *gsizep, GZSTATE_LEN, } state = GZSTATE_MAGIC0; int flags = 0, skip_count = 0; - int error, done_reading = 0; - uLong crc; + int error = Z_STREAM_ERROR, done_reading = 0; + uLong crc = 0; ssize_t wr; int needmore = 0; @@ -1827,9 +1827,9 @@ print_list(int fd, off_t out, const char *outfile, time_t ts) static int first = 1; #ifndef SMALL static off_t in_tot, out_tot; - uint32_t crc; + uint32_t crc = 0; #endif - off_t in; + off_t in = 0; int rv; if (first) { diff --git a/usr.bin/gzip/unbzip2.c b/usr.bin/gzip/unbzip2.c index 489c9d13c9cb..0c11c32f3849 100644 --- a/usr.bin/gzip/unbzip2.c +++ b/usr.bin/gzip/unbzip2.c @@ -1,4 +1,4 @@ -/* $NetBSD: unbzip2.c,v 1.6 2004/09/05 21:32:30 dsl Exp $ */ +/* $NetBSD: unbzip2.c,v 1.7 2005/06/02 01:51:58 lukem Exp $ */ /* This file is #included by gzip.c */ @@ -6,7 +6,7 @@ static off_t unbzip2(int in, int out, char *pre, size_t prelen, off_t *bytes_in) { int ret, end_of_file; - size_t n; + size_t n = 0; off_t bytes_out = 0; bz_stream bzs; static char *inbuf, *outbuf;