projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
date and time created 87/02/15 16:03:36 by lepreau
[unix-history]
/
usr
/
src
/
local
/
sccscmds
/
sccscmds.ok
/
util
/
patol.c
static char
Sccsid
[]
"@(#)patol 2.1"
;
/*
Function to convert ascii string to long. Converts
positive numbers only. Returns -1 if non-numeric
character encountered.
*/
long
patol
(
s
)
register
char
*
s
;
{
long
i
;
i
=
0
;
while
(*
s
>=
'0'
&& *
s
<=
'9'
)
i
=
10
*
i
+ *
s
++ -
'0'
;
if
(*
s
)
return
(-
1
);
return
(
i
);
}