]> git.lizzy.rs Git - zlib.git/commitdiff
Avoid recursive gzgetc() macro call.
authorMark Adler <madler@alumni.caltech.edu>
Fri, 14 Oct 2016 20:16:07 +0000 (13:16 -0700)
committerMark Adler <madler@alumni.caltech.edu>
Fri, 14 Oct 2016 20:16:07 +0000 (13:16 -0700)
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 709d80ff795f7218f2707047e1cf6e741f396044..8285dac0191cd15be63692fe18df59b7a46a78ea 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -1698,10 +1698,10 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */
 #ifdef Z_PREFIX_SET
 #  undef z_gzgetc
 #  define z_gzgetc(g) \
-          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
 #else
 #  define gzgetc(g) \
-          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))
+          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
 #endif
 
 /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or