Revision 12455,
294 bytes
checked in by danw, 26 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r12454,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | |
---|
2 | /* |
---|
3 | * atooi.c -- octal version of atoi() |
---|
4 | * |
---|
5 | * $Id: atooi.c,v 1.1.1.1 1999-02-07 18:14:07 danw Exp $ |
---|
6 | */ |
---|
7 | |
---|
8 | #include <h/mh.h> |
---|
9 | |
---|
10 | |
---|
11 | int |
---|
12 | atooi(char *cp) |
---|
13 | { |
---|
14 | register int i, base; |
---|
15 | |
---|
16 | i = 0; |
---|
17 | base = 8; |
---|
18 | while (*cp >= '0' && *cp <= '7') { |
---|
19 | i *= base; |
---|
20 | i += *cp++ - '0'; |
---|
21 | } |
---|
22 | |
---|
23 | return i; |
---|
24 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.