tv_sec in timeval is a long, and a time_t is not necessarily a long.

This commit is contained in:
John Birrell 1998-05-09 09:41:30 +00:00
parent ea565b5141
commit 070a701183
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35874

View File

@ -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());