version 1.7, 2015/10/12 21:09:08 |
version 1.8, 2017/06/12 18:55:42 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
/* |
/* |
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
void * |
void * |
mandoc_realloc(void *ptr, size_t size) |
mandoc_realloc(void *ptr, size_t size) |
{ |
{ |
|
|
ptr = realloc(ptr, size); |
ptr = realloc(ptr, size); |
if (ptr == NULL) |
if (ptr == NULL) |
err((int)MANDOCLEVEL_SYSERR, NULL); |
err((int)MANDOCLEVEL_SYSERR, NULL); |
|
|
void * |
void * |
mandoc_reallocarray(void *ptr, size_t num, size_t size) |
mandoc_reallocarray(void *ptr, size_t num, size_t size) |
{ |
{ |
|
|
ptr = reallocarray(ptr, num, size); |
ptr = reallocarray(ptr, num, size); |
|
if (ptr == NULL) |
|
err((int)MANDOCLEVEL_SYSERR, NULL); |
|
return ptr; |
|
} |
|
|
|
void * |
|
mandoc_recallocarray(void *ptr, size_t oldnum, size_t num, size_t size) |
|
{ |
|
ptr = recallocarray(ptr, oldnum, num, size); |
if (ptr == NULL) |
if (ptr == NULL) |
err((int)MANDOCLEVEL_SYSERR, NULL); |
err((int)MANDOCLEVEL_SYSERR, NULL); |
return ptr; |
return ptr; |