aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-01-16 09:45:09 +1030
committerAlan Modra <amodra@gmail.com>2021-01-16 11:11:52 +1030
commitad92f33d386e050304bf5986f28071ede9dd2284 (patch)
tree36b11de05d11e93bf630af6f1bdf4463a799767d /bfd
parenteb6e6af8c17a8f4e120d79cb5f2451ebe60aaf4e (diff)
downloadgdb-ad92f33d386e050304bf5986f28071ede9dd2284.zip
gdb-ad92f33d386e050304bf5986f28071ede9dd2284.tar.gz
gdb-ad92f33d386e050304bf5986f28071ede9dd2284.tar.bz2
Tidy inflateEnd calls
So that no one need worry about the value of Z_OK. bfd/ * compress.c (decompress_contents): Tidy inflateEnd result test. binutils/ * readelf.c (uncompress_section_contents): Tidy inflateEnd result test.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/compress.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d3282a3..40534b8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
2021-01-16 Alan Modra <amodra@gmail.com>
+ * compress.c (decompress_contents): Tidy inflateEnd result test.
+
+2021-01-16 Alan Modra <amodra@gmail.com>
+
PR 26002
* elflink.c (elf_link_output_extsym): Use version 1 in
.gnu.version for undefined unversioned symbols.
diff --git a/bfd/compress.c b/bfd/compress.c
index 4cd9b2e..2e73c76 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -60,8 +60,7 @@ decompress_contents (bfd_byte *compressed_buffer,
break;
rc = inflateReset (&strm);
}
- rc |= inflateEnd (&strm);
- return rc == Z_OK && strm.avail_out == 0;
+ return inflateEnd (&strm) == Z_OK && rc == Z_OK && strm.avail_out == 0;
}
/* Compress data of the size specified in @var{uncompressed_size}