strtoul.c\stdlib\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdlib/strtoul.c
blob: 951d5e8c7a29a12a3adfb7450142985f0eff6755 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdlib.h>
#include <inttypes.h>
#include <errno.h>
#include <limits.h>
unsigned long strtoul(const char *s, char **p, int base)
{
	uintmax_t x = strtoumax(s, p, base);
	if (x > ULONG_MAX) {
		errno = ERANGE;
		return ULONG_MAX;
	}
	return x;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月27日 02:44:25 +0000

AltStyle によって変換されたページ (->オリジナル) /