Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Jan 2005 13:16:57 -0700
From:      Scott Long <scottl@freebsd.org>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sbin/badsect badsect.c
Message-ID:  <41D9A839.6000800@freebsd.org>
In-Reply-To: <200501031903.j03J3eBd044669@repoman.freebsd.org>
References:  <200501031903.j03J3eBd044669@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:
> rwatson     2005-01-03 19:03:40 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sbin/badsect         badsect.c 
>   Log:
>   The badsect(8) utility uses atol(), which doesn't allow very good error
>   checking and only recognizes numbers in base 10.  The attached patch
>   checks errno after strtol() and uses a base of 0 to allow octal, or hex
>   sector numbers too.
>   
>   PR:             73112
>   Submitted by:   keramida
>   MFC after:      2 weeks
>   
>   Revision  Changes    Path
>   1.21      +4 -1      src/sbin/badsect/badsect.c

I'd argue that atol() is buggy for a number of other reasons also,
mainly that it means that you're limited to 2^31 sectors.  Maybe this
should change to strtoull() ?

Scott



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41D9A839.6000800>