diff options
author | imp <imp@cvs.openbsd.org> | 1998-07-26 16:59:49 +0000 |
---|---|---|
committer | imp <imp@cvs.openbsd.org> | 1998-07-26 16:59:49 +0000 |
commit | debd535bdd1359fdfb12c5a47e7154f2cc4883a4 (patch) | |
tree | 2dc4ac3ec3e6148511dbdf21f868fc8d057d5a9f /games/adventure/wizard.c | |
parent | 31f3e75584f9bac86d0cf4416e9ffd20d84256a6 (diff) |
Modernize time proceedures. Remove obsolete comment
Diffstat (limited to 'games/adventure/wizard.c')
-rw-r--r-- | games/adventure/wizard.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c index c01a76509e2..bffb10fc0ca 100644 --- a/games/adventure/wizard.c +++ b/games/adventure/wizard.c @@ -54,14 +54,13 @@ static char rcsid[] = "$NetBSD: wizard.c,v 1.3 1995/04/24 12:21:41 cgd Exp $"; datime(d,t) int *d,*t; -{ int tvec[2],*tptr; - - time(tvec); - tptr=(int *)localtime(tvec); - *d=tptr[7]+365*(tptr[5]-77); /* day since 1977 (mod leap) */ - /* bug: this will overflow in the year 2066 AD */ - /* it will be attributed to Wm the C's millenial celebration */ - *t=tptr[2]*60+tptr[1]; /* and minutes since midnite */ +{ struct tm *tptr; + time_t tvec; + + time(&tvec); + tptr=localtime(&tvec); + *d=tptr->tm_yday+365*(tptr->tm_year-77); /* day since 1977 (mod leap) */ + *t=tptr->tm_hour*60+tptr->tm_min; /* and minutes since midnite */ } /* pretty painless */ |