[PATCH 2/9] bootwrapper: Add strtoull().

Scott Wood scottwood at freescale.com
Fri Aug 31 02:16:47 EST 2007


On Thu, Aug 30, 2007 at 10:52:22AM -0500, Milton Miller wrote:
> On Thu Aug 30 02:46:38 EST 2007, Scott Wood wrote:
> 
> >+               if (*ptr >= '0' && *ptr <= '9' && *ptr < '0' + base)
> >+                       digit = *ptr - '0';
> >+               else if (*ptr >= 'A' && *ptr < 'A' + base - 10)
> >+                       digit = *ptr - 'A' + 10;
> >+               else if (*ptr >= 'a' && *ptr < 'z' + base - 10)
> >+                       digit = *ptr - 'a' + 10;
> >+               else
> >+                       break;
> 
> 'z' should also be 'a' like the 'A' case.

Oops.

> Should we add <= 'Z' like we do '9', or do we not care about bases > 
> 36?  (It really breaks above base 42).

I personally don't care about bases > 16; I only supported up to 36
because it was easy to do so.

-Scott



More information about the Linuxppc-dev mailing list