summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-23 12:11:18 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-23 12:11:18 +0000
commit889e182fcac9bd2312f07782277ab1e832f9bb75 (patch)
treeef250a703f800ff0d1343e6e88415733a430a57b /mdoc.c
parentac1f227ddd1d860957c848f834ec0dfbe0dbbe83 (diff)
downloadmandoc-889e182fcac9bd2312f07782277ab1e832f9bb75.tar.gz
avoid repetitive code for asprintf error handling
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mdoc.c b/mdoc.c
index 2f1a14d0..814e43b5 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -594,10 +594,7 @@ mdoc_word_append(struct mdoc *mdoc, const char *p)
n = mdoc->last;
addstr = roff_strdup(mdoc->roff, p);
- if (-1 == asprintf(&newstr, "%s %s", n->string, addstr)) {
- perror(NULL);
- exit((int)MANDOCLEVEL_SYSERR);
- }
+ mandoc_asprintf(&newstr, "%s %s", n->string, addstr);
free(addstr);
free(n->string);
n->string = newstr;