1 /* $NetBSD: octtoint.c,v 1.1.1.1 2009/12/13 16:55:04 kardel Exp $ */
4 * octtoint - convert an ascii string in octal to an unsigned
5 * long, with error checking
10 #include "ntp_stdlib.h"
19 register const char *cp
;
28 if (!isdigit((unsigned char)*cp
) || *cp
== '8' || *cp
== '9')
31 return 0; /* overflow */
33 u
+= *cp
++ - '0'; /* ascii dependent */