summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2010-12-02 19:42:47 +0000
committerschwarze <schwarze@openbsd.org>2010-12-02 19:42:47 +0000
commite855815c1eaf603c742a85ab891b24e9e87360aa (patch)
treed86a11aca2adaefba30715106fb74e78ba1df867
parentdon't attach to the hid interface of the ti msp430 (diff)
downloadwireguard-openbsd-e855815c1eaf603c742a85ab891b24e9e87360aa.tar.xz
wireguard-openbsd-e855815c1eaf603c742a85ab891b24e9e87360aa.zip
Properly initialize the manual section to a default when .Dt is missing.
Without this, we died on an assertion. Problem noted and patch provided by kristaps@.
-rw-r--r--usr.bin/mandoc/mdoc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index f7b7b826ddd..117f587c19d 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.70 2010/12/01 22:02:29 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.71 2010/12/02 19:42:47 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -298,6 +298,8 @@ mdoc_macro(MACRO_PROT_ARGS)
! (MDOC_PBODY & m->flags)) {
if ( ! mdoc_pmsg(m, line, ppos, MANDOCERR_BADPROLOG))
return(0);
+ if (NULL == m->meta.msec)
+ m->meta.msec = mandoc_strdup("1");
if (NULL == m->meta.title)
m->meta.title = mandoc_strdup("UNKNOWN");
if (NULL == m->meta.vol)