From 077b31b5606fe551aea2dfe6b09ea6c68b896b6c Mon Sep 17 00:00:00 2001 From: Greg Tucker Date: Fri, 18 Nov 2016 16:29:41 -0700 Subject: [PATCH] igzip: Fix feof usage in examples Change-Id: Ic5f2f3cf62c57b685be6bc4f68a8c8e246452023 Signed-off-by: Greg Tucker --- igzip/igzip_example.c | 2 +- igzip/igzip_sync_flush_example.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/igzip/igzip_example.c b/igzip/igzip_example.c index 189f0a6..7bf2661 100644 --- a/igzip/igzip_example.c +++ b/igzip/igzip_example.c @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) do { stream.avail_in = (uint32_t) fread(inbuf, 1, BUF_SIZE, in); - stream.end_of_stream = feof(in); + stream.end_of_stream = feof(in) ? 1 : 0; stream.next_in = inbuf; do { stream.avail_out = BUF_SIZE; diff --git a/igzip/igzip_sync_flush_example.c b/igzip/igzip_sync_flush_example.c index 4545317..0351d5c 100644 --- a/igzip/igzip_sync_flush_example.c +++ b/igzip/igzip_sync_flush_example.c @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) do { if (stream.internal_state.state == ZSTATE_NEW_HDR) { stream.avail_in = (uint32_t) fread(inbuf, 1, BUF_SIZE, in); - stream.end_of_stream = feof(in); + stream.end_of_stream = feof(in) ? 1 : 0; stream.next_in = inbuf; } do {