summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-31 13:50:19 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-31 13:50:19 +0000
commite487e44b52bbc7bfdb77346cc9a44d1a7c825d2c (patch)
tree643e3b4494b73a5ef92844c79270118743dd2b96 /main.c
parent1cc03ab30aeb29ce86c06ab8fca7da9056992cef (diff)
downloadmandoc-e487e44b52bbc7bfdb77346cc9a44d1a7c825d2c.tar.gz
General clean-ups.
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.c b/main.c
index 8f190960..b200bc4e 100644
--- a/main.c
+++ b/main.c
@@ -220,6 +220,8 @@ main(int argc, char *argv[])
if (fflags & IGN_MACRO)
pflags |= MDOC_IGN_MACRO;
mdoc = mdoc_alloc(&curp, pflags, &mdoccb);
+ if (NULL == mdoc)
+ errx(1, "memory exhausted");
break;
}
@@ -246,8 +248,10 @@ main(int argc, char *argv[])
break;
if (man)
man_reset(man);
- if (mdoc)
- mdoc_reset(mdoc);
+ if (mdoc && ! mdoc_reset(mdoc)) {
+ warnx("memory exhausted");
+ break;
+ }
argv++;
}
rc = NULL == *argv;
@@ -273,8 +277,7 @@ version(void)
{
(void)printf("%s %s\n", __progname, VERSION);
- exit(0);
- /* NOTREACHED */
+ exit(EXIT_SUCCESS);
}
@@ -285,8 +288,7 @@ usage(void)
(void)fprintf(stderr, "usage: %s [-V] [-foption...] "
"[-mformat] [-Toutput] [-Werr...]\n",
__progname);
- exit(1);
- /* NOTREACHED */
+ exit(EXIT_FAILURE);
}