diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-04-04 19:12:10 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-04-04 19:12:10 +0000 |
commit | e49522ba3dd960b1b980543d125db82e3d18d72d (patch) | |
tree | 3d5de386916bdf2859017080b1eec8b0fbcfdbdd /lib/libc/time/difftime.c | |
parent | b484dd7d6435d789a31b9f9a73d84f30f9e40e4e (diff) |
Minor updates from tzcode2002c
Diffstat (limited to 'lib/libc/time/difftime.c')
-rw-r--r-- | lib/libc/time/difftime.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/libc/time/difftime.c b/lib/libc/time/difftime.c index f5e0c9c6bea..d5fa21fec35 100644 --- a/lib/libc/time/difftime.c +++ b/lib/libc/time/difftime.c @@ -4,8 +4,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) && !defined(NOID) -static char elsieid[] = "@(#)difftime.c 7.7"; -static char rcsid[] = "$OpenBSD: difftime.c,v 1.5 1998/01/18 23:24:51 millert Exp $"; +static char elsieid[] = "@(#)difftime.c 7.9"; +static char rcsid[] = "$OpenBSD: difftime.c,v 1.6 2002/04/04 19:12:09 millert Exp $"; #endif /* LIBC_SCCS and not lint */ /*LINTLIBRARY*/ @@ -31,10 +31,16 @@ const time_t time0; time_t delta; time_t hibit; - if (sizeof(time_t) < sizeof(double)) - return (double) time1 - (double) time0; - if (sizeof(time_t) < sizeof(long_double)) - return (long_double) time1 - (long_double) time0; + { + time_t tt; + double d; + long_double ld; + + if (sizeof tt < sizeof d) + return (double) time1 - (double) time0; + if (sizeof tt < sizeof ld) + return (long_double) time1 - (long_double) time0; + } if (time1 < time0) return -difftime(time0, time1); /* |