diff options
author | Nick Clifton <nickc@redhat.com> | 2008-11-25 08:48:49 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2008-11-25 08:48:49 +0000 |
commit | 20359e080aabfd078512ec67d7fc0a8f416aac17 (patch) | |
tree | b146e63bc69bef0a8eae9c524ce79976fdf27c99 /binutils/windmc.c | |
parent | bcae43427ddb7191e82704bfb0351b43905de812 (diff) | |
download | gdb-20359e080aabfd078512ec67d7fc0a8f416aac17.zip gdb-20359e080aabfd078512ec67d7fc0a8f416aac17.tar.gz gdb-20359e080aabfd078512ec67d7fc0a8f416aac17.tar.bz2 |
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/windmc.c')
-rw-r--r-- | binutils/windmc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/binutils/windmc.c b/binutils/windmc.c index 9392d65..c7aa8f8 100644 --- a/binutils/windmc.c +++ b/binutils/windmc.c @@ -1144,7 +1144,7 @@ main (int argc, char **argv) unichar *u; rc_uint_type ul; char *buff; - long flen; + bfd_size_type flen; FILE *fp = fopen (input_filename, "rb"); if (!fp) @@ -1155,7 +1155,8 @@ main (int argc, char **argv) fseek (fp, 0, SEEK_SET); buff = malloc (flen + 3); memset (buff, 0, flen + 3); - fread (buff, 1, flen, fp); + if (fread (buff, 1, flen, fp) < flen) + fatal (_("unable to read contents of %s"), input_filename); fclose (fp); if (mcset_text_in_is_unicode != 1) { |