Subject: Re: bin/3157: ftp dumps core if you try to get a zero length file
To: None <netbsd-bugs@NetBSD.ORG>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 01/29/1997 22:14:11
In article <199701291249.NAA01638@i41am1.ira.uka.de>,
	frueauf@ira.uka.de writes:
> If you try to get a zero length file with ftp, it dumps core with a 
> Floating exception.

Correct.

>>Fix:

*** src/usr.bin/ftp/util.c.orig	Mon Jan 20 13:22:08 1997
--- src/usr.bin/ftp/util.c	Wed Jan 29 22:11:19 1997
*************** progressmeter(flag)
*** 402,408 ****
  
  	if (flag < 0)
  		(void) gettimeofday(&start, (struct timezone *)0);
! 	if (!progress || filesize < 0)
  		return;
  	if (flag < 0) {
  		before.tv_sec = -1;
--- 402,408 ----
  
  	if (flag < 0)
  		(void) gettimeofday(&start, (struct timezone *)0);
! 	if (!progress || filesize < 1)
  		return;
  	if (flag < 0) {
  		before.tv_sec = -1;

-- 
Matthias Scheler				http://colwyn.owl.de/~tron/