Add/update copyright notice in all source code files.
[mmh] / sbr / atooi.c
1
2 /*
3  * atooi.c -- octal version of atoi()
4  *
5  * $Id$
6  *
7  * This code is Copyright (c) 2002, by the authors of nmh.  See the
8  * COPYRIGHT file in the root directory of the nmh distribution for
9  * complete copyright information.
10  */
11
12 #include <h/mh.h>
13
14
15 int
16 atooi(char *cp)
17 {
18     register int i, base;
19
20     i = 0;
21     base = 8;
22     while (*cp >= '0' && *cp <= '7') {
23         i *= base;
24         i += *cp++ - '0';
25     }
26
27     return i;
28 }