On Sat, 16 Nov 2002, Tim Robbins wrote:
> On Fri, Nov 15, 2002 at 03:59:25PM -0800, Julian Elischer wrote:
>
> > Here are the diffs to allow disklabel to correctly create partitions >
> > 1TB (up to 2TB is useful with UFS2) pending a different partitionning
> > scheme. It also allows you to correctly make smaller partitions beyond
> > 1TB which is nice if you don't want to waste 800GB on an array :-)
> >
> >
> > permission to commit please?
> > (pending comments by others)
> >
> > (also the sysinstall changes posted before)
> > (also the bluetooth code)
> [...]
> > - v = atoi(tp);
> > + v = strtoul(tp, NULL, 0);
> > if (v <= 0 || (v % DEV_BSIZE) != 0) {
> > fprintf(stderr,
> > "line %d: %s: bad sector size\n",
>
> Should be == 0, not <= 0 since v is unsigned.
>
> [...]
> > - v = atoi(tp);
> > + v = strtoul(tp, NULL, 0);
> > if (v < 0) {
> > fprintf(stderr, "line %d: %s: bad %s\n",
> > lineno, tp, cp);
>
> v < 0 is impossible.
In the overflow case, strtoul returns ULONG_MAX. Or if you're interested
in catching invalid characters, use endptr.
-Nate
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message