/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:atol.c 12.0$ */
/* $ACIS:atol.c 12.0$ */
/* $Source: /ibm/acis/usr/src/lib/libc/gen/RCS/atol.c,v $ */

#ifndef lint
static char *rcsid = "$Header:atol.c 12.0$";
#endif

#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)atol.c	5.2 (Berkeley) 3/9/86";
#endif LIBC_SCCS and not lint

long
atol(p)
register char *p;
{
	long n;
	register int f;

	n = 0;
	f = 0;
	for(;;p++) {
		switch(*p) {
		case ' ':
		case '\t':
			continue;
		case '-':
			f++;
		case '+':
			p++;
		}
		break;
	}
	while(*p >= '0' && *p <= '9')
		n = n*10 + *p++ - '0';
	return(f? -n: n);
}
