cvs commit: src/sbin/badsect badsect.c

Scott Long scottl at freebsd.org
Mon Jan 3 12:18:34 PST 2005


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


More information about the cvs-src mailing list