summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-30 05:58:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-30 05:58:36 +0000
commite46c16c46ad18d40f21b251bf8995387efa68796 (patch)
tree7113f6e5fd33a5d7a1c6d20a153ccac74342f042 /main.c
parente7cea9dff6d8ebb34cdba4486eef0fcc6ac84160 (diff)
downloadmandoc-e46c16c46ad18d40f21b251bf8995387efa68796.tar.gz
libmdoc and libman now using non-recoverable allocations (simpler code).
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/main.c b/main.c
index fe6c795f..f0d2cb6d 100644
--- a/main.c
+++ b/main.c
@@ -184,11 +184,9 @@ main(int argc, char *argv[])
argv++;
if (*argv && rc) {
if (curp.lastman)
- if ( ! man_reset(curp.lastman))
- rc = 0;
+ man_reset(curp.lastman);
if (curp.lastmdoc)
- if ( ! mdoc_reset(curp.lastmdoc))
- rc = 0;
+ mdoc_reset(curp.lastmdoc);
curp.lastman = NULL;
curp.lastmdoc = NULL;
}
@@ -233,7 +231,6 @@ static struct man *
man_init(struct curparse *curp)
{
int pflags;
- struct man *man;
struct man_cb mancb;
mancb.man_err = merr;
@@ -250,10 +247,7 @@ man_init(struct curparse *curp)
if (curp->fflags & NO_IGN_ESCAPE)
pflags &= ~MAN_IGN_ESCAPE;
- if (NULL == (man = man_alloc(curp, pflags, &mancb)))
- warnx("memory exhausted");
-
- return(man);
+ return(man_alloc(curp, pflags, &mancb));
}
@@ -261,7 +255,6 @@ static struct mdoc *
mdoc_init(struct curparse *curp)
{
int pflags;
- struct mdoc *mdoc;
struct mdoc_cb mdoccb;
mdoccb.mdoc_err = merr;
@@ -280,10 +273,7 @@ mdoc_init(struct curparse *curp)
if (curp->fflags & NO_IGN_CHARS)
pflags &= ~MDOC_IGN_CHARS;
- if (NULL == (mdoc = mdoc_alloc(curp, pflags, &mdoccb)))
- warnx("memory exhausted");
-
- return(mdoc);
+ return(mdoc_alloc(curp, pflags, &mdoccb));
}