Add compat for reallocarray()

This function fails safely in the case where the multiplication would
overflow.
This commit is contained in:
Romain Vimont
2023-02-28 21:43:19 +01:00
parent 6e05d7047a
commit 6dceb32817
3 changed files with 19 additions and 1 deletions

View File

@@ -67,4 +67,8 @@ long nrand48(unsigned short xsubi[3]);
long jrand48(unsigned short xsubi[3]);
#endif
#ifndef HAVE_REALLOCARRAY
void *reallocarray(void *ptr, size_t nmemb, size_t size);
#endif
#endif