1: /*
2: ** OCTAL ASCII TO INTEGER CONVERSION
3: **
4: ** The ascii string 'a' which represents an octal number
5: ** is converted to binary and returned. Conversion stops at any
6: ** non-octal digit.
7: **
8: ** Note that the number may not have a sign, and may not have
9: ** leading blanks.
10: **
11: ** (Intended for converting the status codes in users(FILE))
12: */
13:
14: oatoi(a)
15: char *a;
16: {
17: register int r;
18: register char *p;
19: register char c;
20:
21: r = 0;
22: p = a;
23:
24: while ((c = *p++) >= '0' && c <= '7')
25: r = (r << 3) | (c &= 7);
26:
27: return (r);
28: }
Defined functions
oatoi
defined in line
14; used 4 times