Add original unix v6

This commit is contained in:
memnoth
2018-01-27 22:35:41 +09:00
commit 2c7099ee50
664 changed files with 106254 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
atoi(ap)
char *ap;
{
register n, c;
register char *p;
int f;
p = ap;
n = 0;
f = 0;
loop:
while(*p == ' ' || *p == ' ')
p++;
if(*p == '-') {
f++;
p++;
goto loop;
}
while(*p >= '0' && *p <= '9')
n = n*10 + *p++ - '0';
if(f)
n = -n;
return(n);
}