1 /* $NetBSD: atoo.c,v 1.4 2002/07/10 20:19:38 wiz Exp $ */
4 * Copyright (c) 1991 Carnegie Mellon University
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
13 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 * Carnegie Mellon requests users of this software to return to
19 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
20 * School of Computer Science
21 * Carnegie Mellon University
22 * Pittsburgh PA 15213-3890
24 * any improvements or extensions that they make and grant Carnegie the rights
25 * to redistribute these changes.
27 /* atoo -- convert ascii to octal
29 * Usage: i = atoo (string);
33 * Atoo converts the value contained in "string" into an
34 * unsigned integer, assuming that the value represents
38 * 20-Nov-79 Steven Shafer (sas) at Carnegie-Mellon University
43 #include "supextern.h"
53 while (*p
== ' ' || *p
== ' ')
55 while (*p
>= '0' && *p
<= '7')
56 n
= n
* 8 + *p
++ - '0';