|
|
@ -15,7 +15,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
static inline int sfread(void* out, size_t *restrict size, FILE* f)
|
|
|
|
static inline int sfread(void* out, size_t *restrict size, FILE* f)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return !!(*size = (size_t)fread(out, 1, *size, f));
|
|
|
|
register ssize_t r = fread(out, 1, *size, f);
|
|
|
|
|
|
|
|
return r < 0 ? (perror("failed to read from stdin"), 0) : !!(*size = (size_t)r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int fwrite_all(const void* _buf, size_t sz, size_t num, FILE* out)
|
|
|
|
static int fwrite_all(const void* _buf, size_t sz, size_t num, FILE* out)
|
|
|
|