Module Name:    src
Committed By:   agc
Date:           Sun Oct  4 21:58:25 UTC 2009

Modified Files:
        src/crypto/external/bsd/netpgp/dist/src/lib: compress.c

Log Message:
Get rid of some lint-style issues - pointed out by Poul-Henning Kamp
and FlexeLint (many thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
    src/crypto/external/bsd/netpgp/dist/src/lib/compress.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/compress.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.12 src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.13
--- src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.12	Tue Jun  9 00:51:01 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/compress.c	Sun Oct  4 21:58:25 2009
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: compress.c,v 1.12 2009/06/09 00:51:01 agc Exp $");
+__RCSID("$NetBSD: compress.c,v 1.13 2009/10/04 21:58:25 agc Exp $");
 #endif
 
 #ifdef HAVE_ZLIB_H
@@ -191,7 +191,7 @@
 			(void) fprintf(stderr, "Out of memory in buffer\n");
 			return 0;
 		}
-		len = z->zstream.next_out - &z->out[z->offset];
+		len = (size_t)(z->zstream.next_out - &z->out[z->offset]);
 		if (len > length) {
 			len = length;
 		}
@@ -275,7 +275,7 @@
 			(void) fprintf(stderr, "Out of bz memroy\n");
 			return 0;
 		}
-		len = bz->bzstream.next_out - &bz->out[bz->offset];
+		len = (size_t)(bz->bzstream.next_out - &bz->out[bz->offset]);
 		if (len > length) {
 			len = length;
 		}
@@ -417,8 +417,8 @@
 		     __ops_output_t *out)
 {
 	compress_t	*zip = calloc(1, sizeof(compress_t));
-	size_t		 sz_in = 0;
-	size_t		 sz_out = 0;
+	size_t		 sz_in;
+	size_t		 sz_out;
 	int              r = 0;
 
 	/* compress the data */
@@ -442,7 +442,7 @@
 	}
 
 	sz_in = len * sizeof(unsigned char);
-	sz_out = (sz_in * 1.01) + 12;	/* from zlib webpage */
+	sz_out = ((101 * sz_in) / 100) + 12;	/* from zlib webpage */
 	zip->src = calloc(1, sz_in);
 	zip->dst = calloc(1, sz_out);
 	(void) memcpy(zip->src, data, len);

Reply via email to