=================================================================== RCS file: /cvs/mandoc/Attic/xstd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -p -r1.5 -r1.6 --- mandoc/Attic/xstd.c 2009/01/20 22:55:46 1.5 +++ mandoc/Attic/xstd.c 2009/02/28 13:47:36 1.6 @@ -1,4 +1,4 @@ -/* $Id: xstd.c,v 1.5 2009/01/20 22:55:46 kristaps Exp $ */ +/* $Id: xstd.c,v 1.6 2009/02/28 13:47:36 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -63,6 +63,16 @@ xstrlcpy(char *dst, const char *src, size_t sz) } void * +xrealloc(void *ptr, size_t sz) +{ + void *p; + + if (NULL == (p = realloc(ptr, sz))) + err(EXIT_FAILURE, "realloc"); + return(p); +} + +void * xcalloc(size_t num, size_t sz) { void *p; @@ -104,7 +114,7 @@ xstrlcats(char *buf, const struct mdoc_node *n, size_t } #ifdef __linux__ -/* $OpenBSD: xstd.c,v 1.5 2009/01/20 22:55:46 kristaps Exp $ */ +/* $OpenBSD: xstd.c,v 1.6 2009/02/28 13:47:36 kristaps Exp $ */ /* * Copyright (c) 1998 Todd C. Miller