summaryrefslogtreecommitdiffstats
path: root/mandocdb.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 /mandocdb.c
parentac1f227ddd1d860957c848f834ec0dfbe0dbbe83 (diff)
downloadmandoc-889e182fcac9bd2312f07782277ab1e832f9bb75.tar.gz
avoid repetitive code for asprintf error handling
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 4a8af53d..3ffd851a 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1536,10 +1536,7 @@ parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_node *n)
return(0);
}
- if (-1 == asprintf(&cp, "%s(%s)", n->string, n->next->string)) {
- perror(NULL);
- exit((int)MANDOCLEVEL_SYSERR);
- }
+ mandoc_asprintf(&cp, "%s(%s)", n->string, n->next->string);
putkey(mpage, cp, TYPE_Xr);
free(cp);
return(0);