Subject: Re: libkern's strtoul()
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 06/04/2003 09:23:08
> Does anyone have any problem with it replacing the existing libkern
> strtoul() ?
How about a few bugs/improvements?
> if (c >= '0' && c < ('0' + min(base, 10)))
I think the min() is unnecessary, c <= '9' will do.
The 'c >= base' lower down will stop 8 being an octal digit.
> if (neg && any > 0)
> acc = -acc;
Does that DTRT for overlarge -ve numbers?
I'm not sure what the standard requires?
David
--
David Laight: david@l8s.co.uk