diff options
author | okan <okan> | 2015-03-29 00:21:05 +0000 |
---|---|---|
committer | okan <okan> | 2015-03-29 00:21:05 +0000 |
commit | bc21e4aa37b36b486f7f6ddcb6050e2be93590c1 (patch) | |
tree | da1b2c2fff822dbb33ab2c7b2692cb7599796d03 /xmalloc.c | |
parent | 668da8493abd2abb6242a0a707e4d745c01b1031 (diff) | |
parent | 557cd382dcd973fd96605c3359e3d6dfa45a4fd9 (diff) | |
download | cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.tar.gz cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.tar.xz cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.zip |
cvsimport
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmalloc.c b/xmalloc.c index 059d7b3..ccfaa67 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -61,6 +61,18 @@ xcalloc(size_t no, size_t siz) return(p); } +void * +xreallocarray(void *ptr, size_t nmemb, size_t size) +{ + void *p; + + p = reallocarray(ptr, nmemb, size); + if (p == NULL) + errx(1, "xreallocarray: out of memory (new_size %zu bytes)", + nmemb * size); + return(p); +} + char * xstrdup(const char *str) { |