diff options
author | fenner <fenner@FreeBSD.org> | 2002-11-12 07:09:43 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2002-11-12 07:09:43 +0000 |
commit | 73fa7c5c52e921bca657739755c1ffc51914391d (patch) | |
tree | d31d290a1be1c555c2edce29cac831f6991963de | |
parent | b3245bbb2f8b732ad8cdfec56a73d5498b05fc70 (diff) | |
download | FreeBSD-src-73fa7c5c52e921bca657739755c1ffc51914391d.zip FreeBSD-src-73fa7c5c52e921bca657739755c1ffc51914391d.tar.gz |
Don't divide by zero to calculate the ETA, even if we haven't gotten
any data in 30 seconds.
-rw-r--r-- | usr.bin/fetch/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index f863ef5..1cccc3a 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -150,7 +150,7 @@ stat_display(struct xferstat *xs, int force) fprintf(stderr, " (%lld bytes): %d%%", (long long)xs->size, (int)((100.0 * xs->rcvd) / xs->size)); elapsed = xs->last.tv_sec - xs->start.tv_sec; - if (elapsed > 30) { + if (elapsed > 30 && xs->rcvd > 0) { long remaining; remaining = ((xs->size * elapsed) / xs->rcvd) - elapsed; |