summaryrefslogtreecommitdiff
path: root/lib/libc/stdtime/difftime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdtime/difftime.c')
-rw-r--r--lib/libc/stdtime/difftime.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libc/stdtime/difftime.c b/lib/libc/stdtime/difftime.c
index f178524f5152..1d1519e15939 100644
--- a/lib/libc/stdtime/difftime.c
+++ b/lib/libc/stdtime/difftime.c
@@ -5,7 +5,7 @@
#ifndef lint
#ifndef NOID
-static char elsieid[] = "@(#)difftime.c 7.7";
+static char elsieid[] = "@(#)difftime.c 7.9";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -32,10 +32,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);
/*