X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/8c93af8e9eb62eb23b9862156fbb36edd225ed36..236dae9fb3183b9c1d8bc6f77614797d65800987:/xstd.c diff --git a/xstd.c b/xstd.c index 6442da41..d41cb696 100644 --- a/xstd.c +++ b/xstd.c @@ -1,4 +1,4 @@ -/* $Id: xstd.c,v 1.5 2009/01/20 22:55:46 kristaps Exp $ */ +/* $Id: xstd.c,v 1.7 2009/03/06 14:13:47 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -62,6 +62,16 @@ xstrlcpy(char *dst, const char *src, size_t sz) return(strlcpy(dst, src, sz) < 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) { @@ -83,7 +93,7 @@ xstrdup(const char *p) } int -xstrlcats(char *buf, const struct mdoc_node *n, size_t sz) +xstrlcpys(char *buf, const struct mdoc_node *n, size_t sz) { char *p;