Added a new function reallocarray(). Intended to prevent overflows.