diff options
Diffstat (limited to 'lib/libc/stdtime/difftime.c')
-rw-r--r-- | lib/libc/stdtime/difftime.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libc/stdtime/difftime.c b/lib/libc/stdtime/difftime.c index c79891c..596ea82 100644 --- a/lib/libc/stdtime/difftime.c +++ b/lib/libc/stdtime/difftime.c @@ -6,7 +6,7 @@ #include <sys/cdefs.h> #ifndef lint #ifndef NOID -static char elsieid[] __unused = "@(#)difftime.c 7.7"; +static char elsieid[] __unused = "@(#)difftime.c 7.9"; #endif /* !defined NOID */ #endif /* !defined lint */ __FBSDID("$FreeBSD$"); @@ -36,10 +36,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); /* |