64 bit time_t

This commit is contained in:
christos 2008-12-29 01:53:35 +00:00
parent e12ce13bc6
commit c20a3600e6
1 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lcmd2.c,v 1.14 2006/12/18 20:04:55 christos Exp $ */ /* $NetBSD: lcmd2.c,v 1.15 2008/12/29 01:53:35 christos Exp $ */
/* /*
* Copyright (c) 1983, 1993 * Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)lcmd2.c 8.1 (Berkeley) 6/6/93"; static char sccsid[] = "@(#)lcmd2.c 8.1 (Berkeley) 6/6/93";
#else #else
__RCSID("$NetBSD: lcmd2.c,v 1.14 2006/12/18 20:04:55 christos Exp $"); __RCSID("$NetBSD: lcmd2.c,v 1.15 2008/12/29 01:53:35 christos Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -164,15 +164,16 @@ strtime(struct timeval *t)
fill++; fill++;
} }
if (t->tv_sec > 60) { if (t->tv_sec > 60) {
(void) sprintf(p, fill ? "%02ld:" : "%ld:", t->tv_sec / 60); (void) sprintf(p, fill ? "%02lld:" : "%lld:",
(long long)t->tv_sec / 60);
while (*p++) while (*p++)
; ;
p--; p--;
t->tv_sec %= 60; t->tv_sec %= 60;
fill++; fill++;
} }
(void) sprintf(p, fill ? "%02ld.%02ld" : "%ld.%02ld", (void) sprintf(p, fill ? "%02lld.%02ld" : "%lld.%02ld",
t->tv_sec, t->tv_usec / 10000); (long long)t->tv_sec, (long)t->tv_usec / 10000);
return buf; return buf;
} }