summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-12-04 00:44:19 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-12-04 00:44:19 +0000
commitb028a6aacf5ba78b1c2fe9a989bf898b3fcad956 (patch)
tree3d250fca1ad53c5740de70642dbd5be86de160c8 /usr.bin/mandoc/man_term.c
parentbbd859bf3e389b45bba64cb4fed7f63110aea3f7 (diff)
When a man document contains nothing at all except one or more invalid
macros, do not die on an assertion, but show correct error messages. Assertions of meta data validity suggested by joerg@. ok joerg@
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 5112ec009d3..e9e6edcff81 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.79 2011/11/13 15:46:04 schwarze Exp $ */
+/* $Id: man_term.c,v 1.80 2011/12/04 00:44:18 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -959,6 +959,9 @@ print_man_foot(struct termp *p, const void *arg)
const struct man_meta *meta;
meta = (const struct man_meta *)arg;
+ assert(meta->title);
+ assert(meta->msec);
+ assert(meta->date);
term_fontrepl(p, TERMFONT_NONE);
@@ -1009,6 +1012,8 @@ print_man_head(struct termp *p, const void *arg)
const struct man_meta *m;
m = (const struct man_meta *)arg;
+ assert(m->title);
+ assert(m->msec);
/*
* Note that old groff would spit out some spaces before the