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
This commit is contained in:
Tim Kientzle 2008-11-05 06:40:53 +00:00
parent f4e24c4e7a
commit 025b20f6e5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184669

View File

@ -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);