public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* gas/compress-debug.c init all of strm
@ 2023-03-14  2:03 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-03-14  2:03 UTC (permalink / raw)
  To: binutils

	* compress-debug.c (compress_init): Clear all of strm.

diff --git a/gas/compress-debug.c b/gas/compress-debug.c
index 7c979132ae1..174c70e65d5 100644
--- a/gas/compress-debug.c
+++ b/gas/compress-debug.c
@@ -20,6 +20,7 @@
 
 #include "config.h"
 #include <stdio.h>
+#include <string.h>
 #include <zlib.h>
 #if HAVE_ZSTD
 #include <zstd.h>
@@ -39,10 +40,7 @@ compress_init (bool use_zstd)
   }
 
   static struct z_stream_s strm;
-
-  strm.zalloc = NULL;
-  strm.zfree = NULL;
-  strm.opaque = NULL;
+  memset (&strm, 0, sizeof (strm));
   deflateInit (&strm, Z_DEFAULT_COMPRESSION);
   return &strm;
 }

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-14  2:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14  2:03 gas/compress-debug.c init all of strm Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).