1 commit 1c9170065b107672a47e467abb6807bba8adf28e
2 Author: Francois Gouget <fgouget@codeweavers.com>
3 Date: Tue Dec 20 18:48:52 2011 +0100
5 ar: Fix handling of archive elements larger than 2GB.
7 diff --git a/binutils/ar.c b/binutils/ar.c
8 index 0310b6f..e47779f 100644
11 @@ -927,10 +927,10 @@ open_inarch (const char *archive_filename, const char *file)
13 print_contents (bfd *abfd)
16 + bfd_size_type ncopied = 0;
17 char *cbuf = (char *) xmalloc (BUFSIZE);
21 if (bfd_stat_arch_elt (abfd, &buf) != 0)
22 /* xgettext:c-format */
23 fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
24 @@ -944,12 +944,12 @@ print_contents (bfd *abfd)
25 while (ncopied < size)
29 - size_t tocopy = size - ncopied;
30 + bfd_size_type nread;
31 + bfd_size_type tocopy = size - ncopied;
35 - nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
36 + nread = bfd_bread (cbuf, tocopy, abfd);
38 /* xgettext:c-format */
39 fatal (_("%s is not a valid archive"),
40 @@ -980,9 +980,9 @@ extract_file (bfd *abfd)
43 char *cbuf = (char *) xmalloc (BUFSIZE);
44 - size_t nread, tocopy;
47 + bfd_size_type nread, tocopy;
48 + bfd_size_type ncopied = 0;
52 if (bfd_stat_arch_elt (abfd, &buf) != 0)
53 @@ -1017,7 +1017,7 @@ extract_file (bfd *abfd)
57 - nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
58 + nread = bfd_bread (cbuf, tocopy, abfd);
60 /* xgettext:c-format */
61 fatal (_("%s is not a valid archive"),