blob: 8787291c03cb551a5d4ad5760cbb9f4b4ca3c12d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
/* ISC license. */
#include <stdlib.h>
#include <skalibs/alloc.h>
int alloc_realloc (void **x, size_t n)
{
void *y = n ? realloc(*x, n) : (free(*x), alloc(0)) ;
if (!y) return 0 ;
*x = y ;
return 1 ;
}
|