diff options
author | 1998-07-26 16:59:48 +0000 | |
---|---|---|
committer | 1998-07-26 16:59:48 +0000 | |
commit | f980e481b5afe12ce7e10ad2dafb778b9db52725 (patch) | |
tree | 9e469ad06bfd3f30550f2bbf71587c1be436ee6e | |
parent | clean up some things left from my debugging activity. (diff) | |
download | wireguard-openbsd-f980e481b5afe12ce7e10ad2dafb778b9db52725.tar.xz wireguard-openbsd-f980e481b5afe12ce7e10ad2dafb778b9db52725.zip |
Modernize time proceedures. Remove obsolete comment
-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 */ |