Subject: Re: progress(1) buffersize
To: None <tech-userlevel@netbsd.org>
From: Allen Briggs <briggs@netbsd.org>
List: tech-userlevel
Date: 06/04/2007 15:45:15
On Mon, Jun 04, 2007 at 07:26:41PM +0000, Christos Zoulas wrote:
> > 	fprintf(stderr,
> >-	    "usage: %s [-ez] [-f file] [-l length] [-p prefix] cmd [args...]\n",
> >-	    getprogname());
> >+	    "usage: %s [-ez] [-b buffersize] [-f file] [-l length]\n"
> >+	    "       %*.s [-p prefix] cmd [args...]\n",
> >+	    getprogname(), (int) strlen(getprogname()), "");
> 
> Why %*.s? we never do this...

Just to line things up nicely.  No other reason.

> >+	long long buffersize;
> 
> Why make buffersize long long, since malloc can only handle size_t?
> Or at least check that buffersize < SIZE_T_MAX.

To match the return type of strsuftoll().  I don't have a problem with
changing it to size_t and restricting the conversion to SIZE_T_MAX
instead of the somewhat arbitrary 256MB.

Thanks,
-allen

-- 
Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com