diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-11-05 06:40:53 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-11-05 06:40:53 +0000 |
commit | b52c677498df68d7d18238af077caee2c3afb987 (patch) | |
tree | 1f9d4d305727510f73d227da56fc49c7f428b41d /usr.bin/tar | |
parent | 17a8787cc850d68b35c32a3e06c17ac0d0ec040a (diff) | |
download | FreeBSD-src-b52c677498df68d7d18238af077caee2c3afb987.zip FreeBSD-src-b52c677498df68d7d18238af077caee2c3afb987.tar.gz |
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
Diffstat (limited to 'usr.bin/tar')
-rw-r--r-- | usr.bin/tar/test/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/tar/test/main.c b/usr.bin/tar/test/main.c index b4e6e61..3bfe6aa 100644 --- a/usr.bin/tar/test/main.c +++ b/usr.bin/tar/test/main.c @@ -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); |