View | Details | Raw Unified | Return to bug 14302 | Differences between
and this patch

Collapse All | Expand All

(-)a/binutils/ar.c (-9 / +9 lines)
Lines 937-946 open_inarch (const char *archive_filename, const char *file) Link Here
937
static void
937
static void
938
print_contents (bfd *abfd)
938
print_contents (bfd *abfd)
939
{
939
{
940
  size_t ncopied = 0;
940
  bfd_size_type ncopied = 0;
941
  char *cbuf = (char *) xmalloc (BUFSIZE);
941
  char *cbuf = (char *) xmalloc (BUFSIZE);
942
  struct stat buf;
942
  struct stat buf;
943
  size_t size;
943
  bfd_size_type size;
944
  if (bfd_stat_arch_elt (abfd, &buf) != 0)
944
  if (bfd_stat_arch_elt (abfd, &buf) != 0)
945
    /* xgettext:c-format */
945
    /* xgettext:c-format */
946
    fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
946
    fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
Lines 954-965 print_contents (bfd *abfd) Link Here
954
  while (ncopied < size)
954
  while (ncopied < size)
955
    {
955
    {
956
956
957
      size_t nread;
957
      bfd_size_type nread;
958
      size_t tocopy = size - ncopied;
958
      bfd_size_type tocopy = size - ncopied;
959
      if (tocopy > BUFSIZE)
959
      if (tocopy > BUFSIZE)
960
	tocopy = BUFSIZE;
960
	tocopy = BUFSIZE;
961
961
962
      nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
962
      nread = bfd_bread (cbuf, tocopy, abfd);
963
      if (nread != tocopy)
963
      if (nread != tocopy)
964
	/* xgettext:c-format */
964
	/* xgettext:c-format */
965
	fatal (_("%s is not a valid archive"),
965
	fatal (_("%s is not a valid archive"),
Lines 990-998 extract_file (bfd *abfd) Link Here
990
{
990
{
991
  FILE *ostream;
991
  FILE *ostream;
992
  char *cbuf = (char *) xmalloc (BUFSIZE);
992
  char *cbuf = (char *) xmalloc (BUFSIZE);
993
  size_t nread, tocopy;
993
  bfd_size_type nread, tocopy;
994
  size_t ncopied = 0;
994
  bfd_size_type ncopied = 0;
995
  size_t size;
995
  bfd_size_type size;
996
  struct stat buf;
996
  struct stat buf;
997
997
998
  if (bfd_stat_arch_elt (abfd, &buf) != 0)
998
  if (bfd_stat_arch_elt (abfd, &buf) != 0)
Lines 1027-1033 extract_file (bfd *abfd) Link Here
1027
	if (tocopy > BUFSIZE)
1027
	if (tocopy > BUFSIZE)
1028
	  tocopy = BUFSIZE;
1028
	  tocopy = BUFSIZE;
1029
1029
1030
	nread = bfd_bread (cbuf, (bfd_size_type) tocopy, abfd);
1030
	nread = bfd_bread (cbuf, tocopy, abfd);
1031
	if (nread != tocopy)
1031
	if (nread != tocopy)
1032
	  /* xgettext:c-format */
1032
	  /* xgettext:c-format */
1033
	  fatal (_("%s is not a valid archive"),
1033
	  fatal (_("%s is not a valid archive"),
(-)a/binutils/bucomm.c (-2 / +4 lines)
Lines 427-442 print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose) Link Here
427
	  char timebuf[40];
427
	  char timebuf[40];
428
	  time_t when = buf.st_mtime;
428
	  time_t when = buf.st_mtime;
429
	  const char *ctime_result = (const char *) ctime (&when);
429
	  const char *ctime_result = (const char *) ctime (&when);
430
	  bfd_size_type size;
430
431
431
	  /* POSIX format:  skip weekday and seconds from ctime output.  */
432
	  /* POSIX format:  skip weekday and seconds from ctime output.  */
432
	  sprintf (timebuf, "%.12s %.4s", ctime_result + 4, ctime_result + 20);
433
	  sprintf (timebuf, "%.12s %.4s", ctime_result + 4, ctime_result + 20);
433
434
434
	  mode_string (buf.st_mode, modebuf);
435
	  mode_string (buf.st_mode, modebuf);
435
	  modebuf[10] = '\0';
436
	  modebuf[10] = '\0';
437
	  size = buf.st_size;
436
	  /* POSIX 1003.2/D11 says to skip first character (entry type).  */
438
	  /* POSIX 1003.2/D11 says to skip first character (entry type).  */
437
	  fprintf (file, "%s %ld/%ld %6ld %s ", modebuf + 1,
439
	  fprintf (file, "%s %ld/%ld %6" BFD_VMA_FMT "u %s ", modebuf + 1,
438
		   (long) buf.st_uid, (long) buf.st_gid,
440
		   (long) buf.st_uid, (long) buf.st_gid,
439
		   (long) buf.st_size, timebuf);
441
		   size, timebuf);
440
	}
442
	}
441
    }
443
    }
442
444

Return to bug 14302