home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
TELECOM
/
UUCPBB21
/
uucpbb21.lzh
/
UUCPBB21
/
xatol.c
< prev
Wrap
Text File
|
1994-09-25
|
431b
|
26 lines
/* Copyright 1994 Brad Spencer */
/* Provided at no cost to Bob Billson to do with what he will */
/* A bit different atol, ya it only deals with positive numbers */
#include <stdio.h>
long xatol (s)
char *s;
{
long v = 0;
if (s == NULL || *s == '\0')
return (0);
while (*s && (*s >= '0') && (*s <= '9'))
{
v *= 10;
v += ((*s) - '0');
s++;
}
return (v);
}