svn commit: r184669 - head/usr.bin/tar/test
Tim Kientzle
kientzle at FreeBSD.org
Tue Nov 4 22:40:53 PST 2008
Author: kientzle
Date: Wed Nov 5 06:40:53 2008
New Revision: 184669
URL: http://svn.freebsd.org/changeset/base/184669
Log:
When comparing, cast to the larger size, off_t in this case.
Once we know which one is smaller, then we cast to the smaller size.
Thanks to Xin Li (delphij@)
Pointy hat: /me
Modified:
head/usr.bin/tar/test/main.c
Modified: head/usr.bin/tar/test/main.c
==============================================================================
--- head/usr.bin/tar/test/main.c Wed Nov 5 05:26:11 2008 (r184668)
+++ head/usr.bin/tar/test/main.c Wed Nov 5 06:40:53 2008 (r184669)
@@ -494,7 +494,7 @@ test_assert_empty_file(const char *f1fmt
if (fd < 0) {
fprintf(stderr, " Unable to open %s\n", f1);
} else {
- s = (sizeof(buff) < (size_t)st.st_size) ?
+ s = ((off_t)sizeof(buff) < st.st_size) ?
(ssize_t)sizeof(buff) : (ssize_t)st.st_size;
s = read(fd, buff, s);
hexdump(buff, NULL, s, 0);
More information about the svn-src-head
mailing list