man/parse: proper structure checks for LINE_TP and LINE_PP

This commit is contained in:
nick black 2024-10-02 03:00:01 -04:00
parent 51f473ade8
commit 625609c79b
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -327,7 +327,7 @@ int troff_parse(const unsigned char* map, size_t mlen, pagedom* dom){
current_subsection->ttype = node;
current_para = current_subsection;
}else if(node->ltype == LINE_PP){
if(dom->root == NULL){
if(current_para == NULL){
fprintf(stderr, "paragraph transcends structure\n");
return -1;
}
@ -336,7 +336,7 @@ int troff_parse(const unsigned char* map, size_t mlen, pagedom* dom){
}
current_para->ttype = node;
}else if(node->ltype == LINE_TP){
if(dom->root == NULL){
if(current_para == NULL){
fprintf(stderr, "tagged paragraph transcends structure\n");
return -1;
}