summaryrefslogtreecommitdiff
path: root/bfd/libbfd.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-06-27 14:43:49 +0930
committerAlan Modra <amodra@gmail.com>2017-06-27 14:46:52 +0930
commitea9aafc41a764e4e2dbb88a7b031e886b481b99a (patch)
treede19f0de64bebc223b0113579fe0741de4c7eaae /bfd/libbfd.c
parent79cb3f75debfeb1355f8883143f0f6dc98f70080 (diff)
Warning fix
PR binutils/21665 * libbfd.c (_bfd_generic_get_section_contents): Warning fix. (_bfd_generic_get_section_contents_in_window): Likewise.
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r--bfd/libbfd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index 077645119c..0d9de2b30b 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -815,7 +815,7 @@ _bfd_generic_get_section_contents (bfd *abfd,
filesz = bfd_get_file_size (abfd);
if (offset + count < count
|| offset + count > sz
- || section->filepos + offset + count > filesz)
+ || (ufile_ptr) section->filepos + offset + count > filesz)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
@@ -873,7 +873,7 @@ _bfd_generic_get_section_contents_in_window
sz = section->size;
filesz = bfd_get_file_size (abfd);
if (offset + count > sz
- || section->filepos + offset + count > filesz
+ || (ufile_ptr) section->filepos + offset + count > filesz
|| ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
TRUE))
return FALSE;