projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix missing SIG_DFL, SIG_IGN, SIG_ERR without posix in signal.h
[musl]
/
src
/
stdlib
/
wcstoul.c
1
#include <wchar.h>
2
#include <stdlib.h>
3
#include <inttypes.h>
4
#include <errno.h>
5
#include <limits.h>
6
7
unsigned long wcstoul(const wchar_t *s, wchar_t **p, int base)
8
{
9
intmax_t x;
10
if (sizeof(intmax_t) == sizeof(long))
11
return wcstoumax(s, p, base);
12
x = wcstoimax(s, p, base);
13
if (-x > ULONG_MAX || x > ULONG_MAX) {
14
errno = ERANGE;
15
return ULONG_MAX;
16
}
17
return x;
18
}