2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 /* $Id: atoi.c,v 1.6 1994/06/24 11:53:19 ceriel Exp $ */
9 /* We do not use strtol here for backwards compatibility in behaviour on
13 atoi(register const char *nptr)
18 while (isspace(*nptr)) nptr++;
19 if (*nptr == '+') nptr++;
20 else if (*nptr == '-') {
24 while (isdigit(*nptr)) {
26 total += (*nptr++ - '0');
28 return minus ? -total : total;