Bug 27780 - [PATCH] fetch(1): don't divide by zero when fetching an empty file
Summary: [PATCH] fetch(1): don't divide by zero when fetching an empty file
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dag-Erling Smørgrav
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-05-30 23:10 UTC by leres
Modified: 2001-06-11 19:06 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (462 bytes, patch)
2001-05-30 23:10 UTC, leres
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description leres 2001-05-30 23:10:01 UTC
	If you try to grab a zero length file, fetch(1) prints garbage
	for the "percent done."

Fix: The appended context diff checks for zero length size.

===================================================================
*** fetch.c	2001/05/30 21:54:09	1.1
--- fetch.c	2001/05/30 21:54:54
***************
How-To-Repeat: 
	% fetch http://www-nrg.ee.lbl.gov/leres/a
	Receiving a (0 bytes): -2147483648%
	0 bytes transferred in 0.0 seconds (0.00 Bps)
Comment 1 dd freebsd_committer 2001-06-01 04:59:27 UTC
Responsible Changed
From-To: freebsd-bugs->des

Over to fetch maintainer.
Comment 2 Dag-Erling Smørgrav freebsd_committer 2001-06-01 11:25:36 UTC
State Changed
From-To: open->feedback

Fixed in -CURRENT, awaiting MFC.
Comment 3 Dag-Erling Smørgrav freebsd_committer 2001-06-11 19:06:37 UTC
State Changed
From-To: feedback->closed

MFCed.