mailing list of musl libc
 help / color / mirror / code / Atom feed
733cb16a87d2c0b1b3fe87b31bc0750961529bcd blob 213 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>

void *reallocarray(void *ptr, size_t m, size_t n)
{
	if (n && m > (size_t) -1 / n) {
		errno = ENOMEM;
		return NULL;
	}

	return realloc(ptr, m * n);
}
debug log:

solving 733cb16a ...
found 733cb16a in https://inbox.vuxu.org/musl/20200722002426.23580-1-ariadne@dereferenced.org/

applying [1/1] https://inbox.vuxu.org/musl/20200722002426.23580-1-ariadne@dereferenced.org/
diff --git a/src/malloc/reallocarray.c b/src/malloc/reallocarray.c
new file mode 100644
index 00000000..733cb16a

Checking patch src/malloc/reallocarray.c...
Applied patch src/malloc/reallocarray.c cleanly.

index at:
100644 733cb16a87d2c0b1b3fe87b31bc0750961529bcd	src/malloc/reallocarray.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).