reallocarray.c\malloc\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/malloc/reallocarray.c
blob: 4a6ebe460469b69a6e860f6f1ad643c40c35fbeb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#define _BSD_SOURCE
#include <errno.h>
#include <stdlib.h>
void *reallocarray(void *ptr, size_t m, size_t n)
{
	if (n && m > -1 / n) {
		errno = ENOMEM;
		return 0;
	}
	return realloc(ptr, m * n);
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月10日 21:41:21 +0000

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