diff options
Diffstat (limited to 'mdoc_state.c')
-rw-r--r-- | mdoc_state.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mdoc_state.c b/mdoc_state.c index c3d23197..3938f239 100644 --- a/mdoc_state.c +++ b/mdoc_state.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_state.c,v 1.5 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: mdoc_state.c,v 1.6 2017/05/04 17:48:29 schwarze Exp $ */ /* * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> * @@ -16,6 +16,7 @@ */ #include <sys/types.h> +#include <assert.h> #include <stdlib.h> #include <string.h> @@ -154,7 +155,6 @@ static const state_handler __state_handlers[MDOC_MAX - MDOC_Dd] = { NULL, /* En */ NULL, /* Dx */ NULL, /* %Q */ - NULL, /* br */ NULL, /* sp */ NULL, /* %U */ NULL, /* Ta */ @@ -168,9 +168,10 @@ mdoc_state(struct roff_man *mdoc, struct roff_node *n) { state_handler handler; - if (n->tok == TOKEN_NONE) + if (n->tok == TOKEN_NONE || n->tok < ROFF_MAX) return; + assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); if ( ! (mdoc_macros[n->tok].flags & MDOC_PROLOGUE)) mdoc->flags |= MDOC_PBODY; |