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:
parent
f4e24c4e7a
commit
025b20f6e5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user