Sign in
cobalt
/
cobalt
/
25902c6cb1ab9cfd8ae2ee6b0fb52953f73deda5
/
.
/
third_party
/
musl
/
src
/
malloc
/
reallocarray.c
blob: 4a6ebe460469b69a6e860f6f1ad643c40c35fbeb [
file
] [
log
] [
blame
]
#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
);
}