mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 20:14:06 +08:00
* ar.c (print_contents, extract_file): Cast the return value
of fwrite to size_t.
This commit is contained in:
parent
64ee10b619
commit
84f1d8266b
@ -1,3 +1,8 @@
|
||||
2007-01-25 Kazu Hirata <kazu@codesourcery.com>
|
||||
|
||||
* ar.c (print_contents, extract_file): Cast the return value
|
||||
of fwrite to size_t.
|
||||
|
||||
2007-01-12 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* ar.c (open_inarch): Check fwrite return. Use size_t.
|
||||
|
@ -805,7 +805,11 @@ print_contents (bfd *abfd)
|
||||
/* xgettext:c-format */
|
||||
fatal (_("%s is not a valid archive"),
|
||||
bfd_get_filename (bfd_my_archive (abfd)));
|
||||
if (fwrite (cbuf, 1, nread, stdout) != nread)
|
||||
|
||||
/* fwrite in mingw32 may return int instead of size_t. Cast the
|
||||
return value to size_t to avoid comparison between signed and
|
||||
unsigned values. */
|
||||
if ((size_t) fwrite (cbuf, 1, nread, stdout) != nread)
|
||||
fatal ("stdout: %s", strerror (errno));
|
||||
ncopied += tocopy;
|
||||
}
|
||||
@ -885,7 +889,11 @@ extract_file (bfd *abfd)
|
||||
|
||||
output_file = ostream;
|
||||
}
|
||||
if (fwrite (cbuf, 1, nread, ostream) != nread)
|
||||
|
||||
/* fwrite in mingw32 may return int instead of size_t. Cast
|
||||
the return value to size_t to avoid comparison between
|
||||
signed and unsigned values. */
|
||||
if ((size_t) fwrite (cbuf, 1, nread, ostream) != nread)
|
||||
fatal ("%s: %s", output_filename, strerror (errno));
|
||||
ncopied += tocopy;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user