From 4b9fdc6b971408b6841e4c0b249175fe9e07f24f Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Mon, 1 Jul 2019 17:57:44 +0200 Subject: [PATCH] try remove warning about unused return value of read --- src/shared.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shared.c b/src/shared.c index 7ff8718e5..fcc79bc15 100644 --- a/src/shared.c +++ b/src/shared.c @@ -665,9 +665,10 @@ bool hc_fopen (HCFILE *fp, const char *path, char *mode) { lseek (fd_tmp, 0, SEEK_SET); - read (fd_tmp, check, sizeof(check)); - - if (check[0] == 0x1f && check[1] == 0x8b && check[2] == 0x08) fp->is_gzip = true; + if (read (fd_tmp, check, sizeof(check)) > 0) + { + if (check[0] == 0x1f && check[1] == 0x8b && check[2] == 0x08) fp->is_gzip = true; + } close (fd_tmp); }