summaryrefslogtreecommitdiffstats
path: root/lib/libc/time/difftime.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-04-04 19:12:08 +0000
committermillert <millert@openbsd.org>2002-04-04 19:12:08 +0000
commitd79de7ff7570de640252ff3ab8ae7105f99e6475 (patch)
tree42fc20af1925d3a259726e459ed8381a6efe759a /lib/libc/time/difftime.c
parentSo many clocks, so little time; update to tzdata2002c from elsie.nci.nih.gov (diff)
downloadwireguard-openbsd-d79de7ff7570de640252ff3ab8ae7105f99e6475.tar.xz
wireguard-openbsd-d79de7ff7570de640252ff3ab8ae7105f99e6475.zip
Minor updates from tzcode2002c
Diffstat (limited to 'lib/libc/time/difftime.c')
-rw-r--r--lib/libc/time/difftime.c18
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);
/*