From: Dmitry V. Levin Date: Thu, 8 Jan 2015 15:08:16 +0000 (+0000) Subject: Fix printing of time_t values set in the distant future X-Git-Tag: v4.10~246 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4a9d8323554414cc08f90b6eb991bc6955a64e2;p=strace Fix printing of time_t values set in the distant future * util.c (sprinttime): Increase buffer size. * tests/stat64-v.test: Try to set modification time of the sample file to a value set in the distant future. --- diff --git a/tests/stat64-v.test b/tests/stat64-v.test index 7e08e258..c7ebf49c 100755 --- a/tests/stat64-v.test +++ b/tests/stat64-v.test @@ -22,6 +22,7 @@ $truncate_cmd > "$OUT" 2>&1 || { ./stat $sample > /dev/null || fail_ 'stat failed' +touch -d '1970-01-01 36028797018963968 seconds' $sample || touch -t 0102030405 $sample for f in $sample . /dev/null; do diff --git a/util.c b/util.c index b7476cf2..570888c8 100644 --- a/util.c +++ b/util.c @@ -425,7 +425,7 @@ const char * sprinttime(time_t t) { struct tm *tmp; - static char buf[sizeof("yyyy/mm/dd-hh:mm:ss")]; + static char buf[sizeof(int) * 3 * 6]; if (t == 0) { strcpy(buf, "0");