Skip to content

Commit

Permalink
Fix warning with sections
Browse files Browse the repository at this point in the history
header.sections is 0
header.num_sections is right number to check
  • Loading branch information
michal-josef-spacek authored and rurban committed Mar 3, 2024
1 parent d51cd5a commit 006bd15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,13 +1549,13 @@ read_R2004_section_map (Bit_Chain *restrict dat, Dwg_Data *restrict dwg)
LOG_WARN ("Invalid last_section_address: %" PRIx64 " != %" PRIx64,
section_address, dwg->r2004_header.last_section_address);
}
if (dwg->header.sections
if (dwg->header.num_sections
!= dwg->r2004_header.numgaps + dwg->r2004_header.numsections)
{
error |= DWG_ERR_VALUEOUTOFBOUNDS;
LOG_WARN ("Invalid sections: %d != numgaps: " FORMAT_RL
" + numsections: " FORMAT_RL,
dwg->header.sections, dwg->r2004_header.numgaps,
dwg->header.num_sections, dwg->r2004_header.numgaps,
dwg->r2004_header.numsections);
}
if (!found_section_map_id)
Expand Down

0 comments on commit 006bd15

Please sign in to comment.