diff options
author | yar <yar@FreeBSD.org> | 2006-07-28 11:17:17 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2006-07-28 11:17:17 +0000 |
commit | 403fb810b3552fefa525b5786b50162e8188b294 (patch) | |
tree | b8855acf6774f3904fd48eaf1377bb7b44e5cb95 /usr.bin/netstat | |
parent | 796fd4097a98079313d50a0e0d4e9c4d6f7da45b (diff) | |
download | FreeBSD-src-403fb810b3552fefa525b5786b50162e8188b294.zip FreeBSD-src-403fb810b3552fefa525b5786b50162e8188b294.tar.gz |
Both fields of struct timeval are of a non-basic type,
so we should cast them to a type printf() knows about.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/mroute.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c index e81ca2b..4b73005 100644 --- a/usr.bin/netstat/mroute.c +++ b/usr.bin/netstat/mroute.c @@ -215,8 +215,8 @@ print_bw_meter(struct bw_meter *bw_meter, int *banner_printed) else sprintf(s2, "?"); sprintf(s0, "%lu.%lu|%s|%s", - bw_meter->bm_start_time.tv_sec, - bw_meter->bm_start_time.tv_usec, + (u_long)bw_meter->bm_start_time.tv_sec, + (u_long)bw_meter->bm_start_time.tv_usec, s1, s2); printf(" %-30s", s0); @@ -238,8 +238,8 @@ print_bw_meter(struct bw_meter *bw_meter, int *banner_printed) else sprintf(s2, "?"); sprintf(s0, "%lu.%lu|%s|%s", - bw_meter->bm_threshold.b_time.tv_sec, - bw_meter->bm_threshold.b_time.tv_usec, + (u_long)bw_meter->bm_threshold.b_time.tv_sec, + (u_long)bw_meter->bm_threshold.b_time.tv_usec, s1, s2); printf(" %-30s", s0); @@ -248,11 +248,15 @@ print_bw_meter(struct bw_meter *bw_meter, int *banner_printed) &bw_meter->bm_threshold.b_time, &end); if (timercmp(&now, &end, <=)) { timersub(&end, &now, &delta); - sprintf(s3, "%lu.%lu", delta.tv_sec, delta.tv_usec); + sprintf(s3, "%lu.%lu", + (u_long)delta.tv_sec, + (u_long)delta.tv_usec); } else { /* Negative time */ timersub(&now, &end, &delta); - sprintf(s3, "-%lu.%lu", delta.tv_sec, delta.tv_usec); + sprintf(s3, "-%lu.%lu", + (u_long)delta.tv_sec, + (u_long)delta.tv_usec); } printf(" %s", s3); |