summaryrefslogtreecommitdiff
path: root/binutils/dlltool.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-11-25 08:48:49 +0000
committerNick Clifton <nickc@redhat.com>2008-11-25 08:48:49 +0000
commitb810190a1d206c5d7b9912dd6f20e692d7506e37 (patch)
tree605824ebcd18d327e7ba64b28873516a884a5eaa /binutils/dlltool.c
parent8e9d9b02168bde16b22793d4ea17bc0288708dc0 (diff)
downloadbinutils-redhat-b810190a1d206c5d7b9912dd6f20e692d7506e37.tar.gz
PR7044
* dlltool.c (run): Use formatting string to avoid compile time warning. (gen_exp_file): Check return value from fread. * windmc.c (main): Check return value from fread.
Diffstat (limited to 'binutils/dlltool.c')
-rw-r--r--binutils/dlltool.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index a19400d844..89508f32ae 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -1213,7 +1213,7 @@ run (const char *what, char *args)
if (pid == -1)
{
- inform (strerror (errno));
+ inform ("%s", strerror (errno));
fatal (errmsg_fmt, errmsg_arg);
}
@@ -1998,7 +1998,7 @@ gen_exp_file (void)
bfd_vma addr;
bfd_vma need[PAGE_SIZE];
bfd_vma page_addr;
- int numbytes;
+ bfd_size_type numbytes;
int num_entries;
bfd_vma *copy;
int j;
@@ -2010,7 +2010,8 @@ gen_exp_file (void)
numbytes = ftell (base_file);
fseek (base_file, 0, SEEK_SET);
copy = xmalloc (numbytes);
- fread (copy, 1, numbytes, base_file);
+ if (fread (copy, 1, numbytes, base_file) < numbytes)
+ fatal (_("failed to read the number of entries from base file"));
num_entries = numbytes / sizeof (bfd_vma);