tv_sec in timeval is a long, and a time_t is not necessarily a long.
This commit is contained in:
parent
88c50b200a
commit
ae8864f6a2
@ -103,11 +103,13 @@ post(ch)
|
|||||||
char ch;
|
char ch;
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
char *date, *ctime();
|
char *date;
|
||||||
|
time_t tvsec;
|
||||||
int s = sigblock(sigmask(SIGINT));
|
int s = sigblock(sigmask(SIGINT));
|
||||||
|
|
||||||
gettimeofday(&tv, (struct timezone *)0); /* can't call time */
|
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';
|
date[24] = '\0';
|
||||||
|
|
||||||
fprintf(score_fp, "%s %8s %c%20s", date, uname, ch, rate());
|
fprintf(score_fp, "%s %8s %c%20s", date, uname, ch, rate());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user