]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/atooi.c
Create new mh-format function %(ordinal)
[nmh] / docs / historical / mh-jun-1982 / subs / atooi.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8
9 /* octal version of atoi */
10 atooi(cp)
11 register char *cp;
12 {
13 register int i, base;
14
15 i = 0;
16 base = 8;
17 while(*cp >= '0' && *cp <= '7') {
18 i *= base;
19 i += *cp++ - '0';
20 }
21 return(i);
22 }