projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
make pthread_create return EAGAIN on resource failure, as required by POSIX
[oweals/musl.git]
/
src
/
stdlib
/
atoi.c
1
#include <stdlib.h>
2
#include <ctype.h>
3
4
int atoi(const char *s)
5
{
6
int n=0, neg=0;
7
while (isspace(*s)) s++;
8
switch (*s) {
9
case '-': neg=1;
10
case '+': s++;
11
}
12
while (isdigit(*s))
13
n = 10*n + *s++ - '0';
14
return neg ? -n : n;
15
}