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