From 0a60672d638c31e52f69106719b85454cc4ac959 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 6 Jan 2015 02:04:10 +0000 Subject: [PATCH] pass the original 64 bit value to the cdf_ converted to avoid truncation. (from Christoph Biedl) --- src/print.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/print.c b/src/print.c index 3216b9b9..501236f6 100644 --- a/src/print.c +++ b/src/print.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: print.c,v 1.76 2013/02/26 18:25:00 christos Exp $") +FILE_RCSID("@(#)$File: print.c,v 1.77 2015/01/02 21:29:39 christos Exp $") #endif /* lint */ #include @@ -232,13 +232,17 @@ protected const char * file_fmttime(uint64_t v, int flags, char *buf) { char *pp; - time_t t = (time_t)v; + time_t t; struct tm *tm; if (flags & FILE_T_WINDOWS) { struct timespec ts; - cdf_timestamp_to_timespec(&ts, t); + cdf_timestamp_to_timespec(&ts, v); t = ts.tv_sec; + } else { + // XXX: perhaps detect and print something if overflow + // on 32 bit time_t? + t = (time_t)v; } if (flags & FILE_T_LOCAL) { -- 2.40.0