diff --git a/src/man/main.c b/src/man/main.c index ff2810897..297e8c52b 100644 --- a/src/man/main.c +++ b/src/man/main.c @@ -351,11 +351,13 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n, putpara(p, n->text); } }else{ - ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC); - ncplane_set_fg_rgb(p, 0xff6a00); - ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text); - ncplane_set_fg_default(p); - ncplane_set_styles(p, NCSTYLE_NONE); + if(n->text){ + ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC); + ncplane_set_fg_rgb(p, 0xff6a00); + ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text); + ncplane_set_fg_default(p); + ncplane_set_styles(p, NCSTYLE_NONE); + } } *wrotetext = true; break; diff --git a/src/man/parse.c b/src/man/parse.c index 51609cccd..fd3f1de69 100644 --- a/src/man/parse.c +++ b/src/man/parse.c @@ -104,7 +104,7 @@ const trofftype* get_type(const struct troffnode* trie, const unsigned char** ws ++*ws; --len; while(len && !isspace(**ws) && **ws){ - if(**ws > sizeof(trie->next) / sizeof(*trie->next)){ // illegal command + if(**ws >= sizeof(trie->next) / sizeof(*trie->next)){ // illegal command return NULL; } if((trie = trie->next[**ws]) == NULL){