diff options
Diffstat (limited to 'games')
-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 */ |