home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
SMC21LIB.LZH
/
OTOI.C
< prev
next >
Wrap
Text File
|
2000-06-30
|
512b
|
25 lines
#include stdio.h
/*
** otoi -- convert unsigned octal string to integer nbr
** returns field size, else ERR on error
*/
otoi(octstr, nbr) char *octstr; int *nbr; {
int d, t; d=0;
*nbr=0;
while((*octstr>'0')&(*octstr<='7')) {
t=*nbr;
t=(t<<3) +(*octstr++ - '0');
if ((t>=0)&(*nbr<0)) return ERR;
d++; *nbr=t;
}
return d;
}
8,029,
030,031,032,033,034,035,036,037,038,039,
040,041,042,043,044,045,046,047,
/**** 0 to 9 ****/
065,06