atoi, for kill
This commit is contained in:
parent
e0924827ee
commit
e204d0a151
11
ulib.c
11
ulib.c
|
@ -88,3 +88,14 @@ stat(char *n, struct stat *st)
|
|||
close(fd);
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
atoi(const char *s)
|
||||
{
|
||||
int n;
|
||||
|
||||
n = 0;
|
||||
while('0' <= *s && *s <= '9')
|
||||
n = n*10 + *s++ - '0';
|
||||
return n;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue