diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-23 12:11:18 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-23 12:11:18 +0000 |
commit | e7bd52bb8b529ce7e10d5d912a85f84a34390698 (patch) | |
tree | 3cc12c7d5b6107fca4f838ecf91873b3f4df4d30 /roff.c | |
parent | 6d94a3c6ad51f302ad5516621ce9fa533b37055a (diff) | |
download | mandoc-e7bd52bb8b529ce7e10d5d912a85f84a34390698.tar.gz mandoc-e7bd52bb8b529ce7e10d5d912a85f84a34390698.tar.zst mandoc-e7bd52bb8b529ce7e10d5d912a85f84a34390698.zip |
avoid repetitive code for asprintf error handling
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.201 2014/03/23 11:25:26 schwarze Exp $ */ +/* $Id: roff.c,v 1.202 2014/03/23 12:11:18 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -656,11 +656,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; |