lang-bootstrap/05/musl-final/src/stdlib/wcstoul.c
2025-04-05 10:55:40 +01:00

15 lines
280 B
C

#include <wchar.h>
#include <stdlib.h>
#include <inttypes.h>
#include <errno.h>
#include <limits.h>
unsigned long wcstoul(const wchar_t *s, wchar_t **p, int base)
{
uintmax_t x = wcstoumax(s, p, base);
if (x > ULONG_MAX) {
errno = ERANGE;
return ULONG_MAX;
}
return x;
}