2 * hextoint - convert an ascii string in hex to an unsigned
3 * long, with error checking
8 #include "ntp_stdlib.h"
17 register const char *cp;
26 if (!isxdigit((unsigned char)*cp))
29 return 0; /* overflow */
31 if ('0' <= *cp && *cp <= '9')
33 else if ('a' <= *cp && *cp <= 'f')
34 u += *cp++ - 'a' + 10;
35 else if ('A' <= *cp && *cp <= 'F')
36 u += *cp++ - 'A' + 10;