1: /* atooi.c - octal version of atoi() */ 2: 3: 4: int atooi(cp) 5: register char *cp; 6: { 7: register int i, 8: base; 9: 10: i = 0; 11: base = 8; 12: while (*cp >= '0' && *cp <= '7') { 13: i *= base; 14: i += *cp++ - '0'; 15: } 16: 17: return i; 18: }