home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
small_c
/
sc88.arc
/
OTOI.C
< prev
next >
Wrap
Text File
|
1987-10-04
|
384b
|
17 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;
}