4 * hextoint - convert an ascii string in hex to an unsigned
5 * long, with error checking
9 #include "ntp_stdlib.h"
18 register const char *cp
;
30 return 0; /* overflow */
32 if ('0' <= *cp
&& *cp
<= '9')
34 else if ('a' <= *cp
&& *cp
<= 'f')
35 u
+= *cp
++ - 'a' + 10;
36 else if ('A' <= *cp
&& *cp
<= 'F')
37 u
+= *cp
++ - 'A' + 10;