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
/
ATOIB.C
< prev
next >
Wrap
Text File
|
2000-06-30
|
512b
|
21 lines
#define NOCCARGC
/*
** atoib(s,b) - convert s to "unsigned" integer in base b.
** Note: this is a non-standard function.
*/
atoib(s, b) char *s; int b; {
int n, digit;
n = 0;
while(isspace(*s)) ++s;
while((digit = (127 & s++)) >= '0') {
if(digit >= 'a') digit -= 87;
else if(digit >= 'A') digit -= 55;
else digit -= '0';
if(digit >= b) break;
n = b * n + digit;
}
return (n);
}