-
/*
* atooi.c -- octal version of atoi()
*
int
atooi(char *cp)
{
- register int i, base;
+ register int i, base;
- i = 0;
- base = 8;
- while (*cp >= '0' && *cp <= '7') {
- i *= base;
- i += *cp++ - '0';
- }
+ i = 0;
+ base = 8;
+ while (*cp >= '0' && *cp <= '7') {
+ i *= base;
+ i += *cp++ - '0';
+ }
- return i;
+ return i;
}