summaryrefslogtreecommitdiff
path: root/snappy-test.h
diff options
context:
space:
mode:
Diffstat (limited to 'snappy-test.h')
-rw-r--r--snappy-test.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/snappy-test.h b/snappy-test.h
index 649f26e..ef6a955 100644
--- a/snappy-test.h
+++ b/snappy-test.h
@@ -135,7 +135,7 @@ namespace File {
while (!feof(fp)) {
char buf[4096];
size_t ret = fread(buf, 1, 4096, fp);
- if (ret == -1) {
+ if (ret == 0 && ferror(fp)) {
perror("fread");
exit(1);
}