summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/roff.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-03-21 22:52:21 +0000
committerschwarze <schwarze@openbsd.org>2014-03-21 22:52:21 +0000
commita450f7c4606ace33f6c25ac82bb7b06a0baaa71c (patch)
tree9b96cddcd495fda4976fc6f15f4ae66fdb1e8f96 /usr.bin/mandoc/roff.c
parentThe files mandoc.c and mandoc.h contained both specialised low-level (diff)
downloadwireguard-openbsd-a450f7c4606ace33f6c25ac82bb7b06a0baaa71c.tar.xz
wireguard-openbsd-a450f7c4606ace33f6c25ac82bb7b06a0baaa71c.zip
avoid repetitive code for asprintf error handling
Diffstat (limited to 'usr.bin/mandoc/roff.c')
-rw-r--r--usr.bin/mandoc/roff.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index caced523938..0084569fb7d 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.74 2014/03/21 22:17:01 schwarze Exp $ */
+/* $Id: roff.c,v 1.75 2014/03/21 22:52:21 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -652,11 +652,7 @@ roff_parsetext(char **bufp, size_t *szp, int pos, int *offs)
/* Spring the input line trap. */
if (1 == roffit_lines) {
- isz = asprintf(&p, "%s\n.%s", *bufp, roffit_macro);
- if (-1 == isz) {
- perror(NULL);
- exit((int)MANDOCLEVEL_SYSERR);
- }
+ isz = mandoc_asprintf(&p, "%s\n.%s", *bufp, roffit_macro);
free(*bufp);
*bufp = p;
*szp = isz + 1;