mirror of
https://github.com/facebook/zstd.git
synced 2025-07-30 22:23:13 +03:00
fix harness test
This commit is contained in:
@ -39,19 +39,15 @@ static size_t read_file(const char *path, u8 **ptr)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t pos = 0;
|
size_t const read = fread(*ptr, 1, size, f);
|
||||||
while (!feof(f)) {
|
if (read != size) { /* must read everything in one pass */
|
||||||
size_t const read = fread(*ptr + pos, 1, size, f);
|
fprintf(stderr, "error while reading file %s \n", path);
|
||||||
if (ferror(f)) {
|
exit(1);
|
||||||
fprintf(stderr, "error while reading file %s \n", path);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
pos += read;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
return pos;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_file(const char *path, const u8 *ptr, size_t size)
|
static void write_file(const char *path, const u8 *ptr, size_t size)
|
||||||
|
Reference in New Issue
Block a user