]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Avoid recursive gzgetc() macro call.
authorMark Adler <madler@alumni.caltech.edu>
Fri, 14 Oct 2016 20:16:07 +0000 (13:16 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Wed, 1 Feb 2017 11:07:50 +0000 (12:07 +0100)
Recursive macro calls are normally caught by the preprocessor and
avoided. This commit avoids the possibility of a problem entirely.

zlib.h

diff --git a/zlib.h b/zlib.h
index 91bd18e9ff910d1f55430e0498958ea517b51914..f2c82a40363198fa891c0c5bf30f21460393211b 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -1647,7 +1647,7 @@ struct gzFile_s {
     z_off64_t pos;
 };
 ZEXTERN int ZEXPORT gzgetc_(gzFile file);  /* backward compatibility */
-#  define gzgetc(g) ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+#  define gzgetc(g) ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
 
 /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
  * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if