{
struct timeval tv;
gettimeofday(&tv, NULL);
- (void) sprintf(CS timebuf, "%ld%06ld", tv.tv_sec, tv.tv_usec ); /* Unix epoch/usec format */
+ /* Unix epoch/usec format */
+ (void) sprintf(CS timebuf, TIME_T_FMT "%06ld", tv.tv_sec, (long) tv.tv_usec );
return timebuf;
}
else if (type == tod_epoch)
{
- (void) sprintf(CS timebuf, "%d", (int)now); /* Unix epoch format */
- return timebuf;
+ (void) sprintf(CS timebuf, TIME_T_FMT, now); /* Unix epoch format */
+ return timebuf; /* NB the above will be wrong if time_t is FP */
}
else if (type == tod_zulu)