ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit 0d618b3dea32b19fdb253f23ec51bfc1d5fc6cae
parent 8cd7c6f9bb5be31e1d38a30c5c5bdd182404fc58
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 19 Oct 2020 11:53:51 +0200

Introduce the READ_RECORD function-like macro, for fread error handling.

Diffstat:
Msrc/sauce.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/sauce.c b/src/sauce.c @@ -44,6 +44,11 @@ sauceReadFile(FILE *file) return record; } +#define READ_RECORD(record, size) \ + read_status = fread(record, size, 1, file); \ + if (read_status != 1) \ + return; + void readRecord(FILE *file, struct sauce *record) {