Thread (18 messages) 18 messages, 3 authors, 2007-08-31

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

From: Scott Wood <hidden>
Date: 2007-08-30 16:17:05

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:
quoted
+               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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help