mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
xmalloc: add xreallocarray()
This commit is contained in:
parent
9443ac7e29
commit
aae794e9bd
2 changed files with 8 additions and 0 deletions
|
|
@ -36,6 +36,13 @@ xrealloc(void *ptr, size_t size)
|
|||
return unlikely(size == 0) ? alloc : check_alloc(alloc);
|
||||
}
|
||||
|
||||
void *
|
||||
xreallocarray(void *ptr, size_t n, size_t size)
|
||||
{
|
||||
void *alloc = reallocarray(ptr, n, size);
|
||||
return unlikely(size == 0) ? alloc : check_alloc(alloc);
|
||||
}
|
||||
|
||||
char *
|
||||
xstrdup(const char *str)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue