From e35c930e4666512fc59519f6d9bf73cba4ecfcbc Mon Sep 17 00:00:00 2001 From: cgd Date: Wed, 7 Jun 1995 16:29:30 +0000 Subject: typeof(timeval.ts_sec) != time_t --- pom/pom.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pom') diff --git a/pom/pom.c b/pom/pom.c index 7b1ecc09..8a9f40f8 100644 --- a/pom/pom.c +++ b/pom/pom.c @@ -1,4 +1,4 @@ -/* $NetBSD: pom.c,v 1.4 1995/03/23 08:35:36 cgd Exp $ */ +/* $NetBSD: pom.c,v 1.5 1995/06/07 16:30:46 cgd Exp $ */ /* * Copyright (c) 1989, 1993 @@ -45,7 +45,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: pom.c,v 1.4 1995/03/23 08:35:36 cgd Exp $"; +static char rcsid[] = "$NetBSD: pom.c,v 1.5 1995/06/07 16:30:46 cgd Exp $"; #endif #endif /* not lint */ @@ -82,6 +82,7 @@ main() struct timeval tp; struct timezone tzp; struct tm *GMT, *gmtime(); + time_t tmpt; double days, today, tomorrow; int cnt; @@ -89,7 +90,8 @@ main() (void)fprintf(stderr, "pom: %s\n", strerror(errno)); exit(1); } - GMT = gmtime(&tp.tv_sec); + tmpt = tp.tv_sec; + GMT = gmtime(&tmpt); days = (GMT->tm_yday + 1) + ((GMT->tm_hour + (GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0); for (cnt = EPOCH; cnt < GMT->tm_year; ++cnt) -- cgit v1.2.3-56-ge451