]> git.lizzy.rs Git - zlib.git/blobdiff - deflate.c
Fix CLEAR_HASH macro to be usable as a single statement.
[zlib.git] / deflate.c
index e97bd878341166e295d272a11204338a2b9233f4..568eaddbe915eeae9a6998bb4e443a10c054b543 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -190,8 +190,11 @@ local const config configuration_table[10] = {
  * prev[] will be initialized on the fly.
  */
 #define CLEAR_HASH(s) \
-    s->head[s->hash_size-1] = NIL; \
-    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+    do { \
+        s->head[s->hash_size-1] = NIL; \
+        zmemzero((Bytef *)s->head, \
+                 (unsigned)(s->hash_size-1)*sizeof(*s->head)); \
+    } while (0)
 
 /* ===========================================================================
  * Slide the hash table when sliding the window down (could be avoided with 32