projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
yet another ugly legacy syscall rename...
[oweals/musl.git]
/
src
/
stdlib
/
atol.c
1
#include <stdlib.h>
2
#include <ctype.h>
3
4
long atol(const char *s)
5
{
6
long n=0;
7
int neg=0;
8
while (isspace(*s)) s++;
9
switch (*s) {
10
case '-': neg=1;
11
case '+': s++;
12
}
13
while (isdigit(*s))
14
n = 10*n + *s++ - '0';
15
return neg ? -n : n;
16
}