181351 posts 1993 follows 1215 followers
Please pay attention to random failures.
https://mstdn.maud.io/@omasanoriAnother friend of #OpenBSD's @malloc is recallocarray(p, n, newn, sz); It reallocates an array from n to newn members, and does the tedious clearing of new mem for you, plus overflow checking. If you're shrinking, data is explicitly cleared as well. http://man.openbsd.org/malloc#IDIOMS