Module Name: src
Committed By: riastradh
Date: Sat May 4 14:29:48 UTC 2013
Modified Files:
src/usr.bin/vndcompress: vndcompress.c
Log Message:
Fix sign-compare in compress_blocks.
Not sure why my builds didn't reveal this one -- they revealed
several others during development.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/vndcompress/vndcompress.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/vndcompress/vndcompress.c
diff -u src/usr.bin/vndcompress/vndcompress.c:1.9 src/usr.bin/vndcompress/vndcompress.c:1.10
--- src/usr.bin/vndcompress/vndcompress.c:1.9 Sat May 4 10:21:27 2013
+++ src/usr.bin/vndcompress/vndcompress.c Sat May 4 14:29:48 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: vndcompress.c,v 1.9 2013/05/04 10:21:27 joerg Exp $ */
+/* $NetBSD: vndcompress.c,v 1.10 2013/05/04 14:29:48 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: vndcompress.c,v 1.9 2013/05/04 10:21:27 joerg Exp $");
+__RCSID("$NetBSD: vndcompress.c,v 1.10 2013/05/04 14:29:48 riastradh Exp $");
#include <sys/endian.h>
@@ -792,7 +792,7 @@ compress_block(int in_fd, int out_fd, ui
err(1, "read block %"PRIu32, blkno);
assert(n_read >= 0);
assert((uintmax_t)n_read <= (uintmax_t)readsize);
- if (n_read < readsize)
+ if ((uint32_t)n_read < readsize)
errx(1, "partial read of block %"PRIu32": %zd <= %"PRIu32,
blkno, n_read, readsize);