From 070a701183b9a7dd462b43c18225e0b70e3fdd29 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Sat, 9 May 1998 09:41:30 +0000 Subject: [PATCH] tv_sec in timeval is a long, and a time_t is not necessarily a long. --- games/battlestar/com6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/games/battlestar/com6.c b/games/battlestar/com6.c index 5d196314e3ee..ddfac6720309 100644 --- a/games/battlestar/com6.c +++ b/games/battlestar/com6.c @@ -103,11 +103,13 @@ post(ch) char ch; { struct timeval tv; - char *date, *ctime(); + char *date; + time_t tvsec; int s = sigblock(sigmask(SIGINT)); gettimeofday(&tv, (struct timezone *)0); /* can't call time */ - date = ctime(&tv.tv_sec); + tvsec = (time_t) tv.tv_sec; + date = ctime(&tvsec); date[24] = '\0'; fprintf(score_fp, "%s %8s %c%20s", date, uname, ch, rate());