summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-08-10 03:25:40 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-08-10 03:25:40 +0000
commit454c7db1ac655f68f479a3306ad75d0c13290959 (patch)
treef74ef1cd305d3a9f96165d88dad63525eb853683
parentf714e8e2631625e3a5edc504e032643579078a08 (diff)
Format time_t with %lld after casting to long long
-rw-r--r--gnu/usr.bin/binutils/bfd/archive.c4
-rw-r--r--gnu/usr.bin/binutils/bfd/som.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/binutils/bfd/archive.c b/gnu/usr.bin/binutils/bfd/archive.c
index 6c8397c71bb..c440bb38c54 100644
--- a/gnu/usr.bin/binutils/bfd/archive.c
+++ b/gnu/usr.bin/binutils/bfd/archive.c
@@ -1937,7 +1937,7 @@ bsd_write_armap (bfd *arch,
bfd_ardata (arch)->armap_timestamp = statbuf.st_mtime + ARMAP_TIME_OFFSET;
bfd_ardata (arch)->armap_datepos = (SARMAG
+ offsetof (struct ar_hdr, ar_date[0]));
- sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
+ sprintf (hdr.ar_date, "%lld", (long long)bfd_ardata (arch)->armap_timestamp);
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
@@ -2030,7 +2030,7 @@ _bfd_archive_bsd_update_armap_timestamp (bfd *arch)
/* Prepare an ASCII version suitable for writing. */
memset (hdr.ar_date, 0, sizeof (hdr.ar_date));
- sprintf (hdr.ar_date, "%ld", bfd_ardata (arch)->armap_timestamp);
+ sprintf (hdr.ar_date, "%lld", (long long)bfd_ardata (arch)->armap_timestamp);
for (i = 0; i < sizeof (hdr.ar_date); i++)
if (hdr.ar_date[i] == '\0')
(hdr.ar_date)[i] = ' ';
diff --git a/gnu/usr.bin/binutils/bfd/som.c b/gnu/usr.bin/binutils/bfd/som.c
index 90662575bbd..2edce232253 100644
--- a/gnu/usr.bin/binutils/bfd/som.c
+++ b/gnu/usr.bin/binutils/bfd/som.c
@@ -6249,7 +6249,7 @@ som_write_armap (abfd, elength, map, orl_count, stridx)
lst.checksum ^= *p++;
sprintf (hdr.ar_name, "/ ");
- sprintf (hdr.ar_date, "%ld", bfd_ardata (abfd)->armap_timestamp);
+ sprintf (hdr.ar_date, "%lld", (long long)bfd_ardata (abfd)->armap_timestamp);
sprintf (hdr.ar_uid, "%ld", (long) getuid ());
sprintf (hdr.ar_gid, "%ld", (long) getgid ());
sprintf (hdr.ar_mode, "%-8o", (unsigned int) statbuf.st_mode);