2 * atouint - convert an ascii string to an unsigned long, with error checking
8 #include "ntp_stdlib.h"
17 register const char *cp;
25 if (!isdigit((int)*cp))
27 if (u > 429496729 || (u == 429496729 && *cp >= '6'))
28 return 0; /* overflow */
29 u = (u << 3) + (u << 1);
30 u += *cp++ - '0'; /* ascii dependent */