Skip to content

Commit

Permalink
Handle extra spare bits in 8_1_29
Browse files Browse the repository at this point in the history
  • Loading branch information
schwehr committed Nov 26, 2012
1 parent 4eef2e1 commit 0eda416
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ais8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,9 @@ Ais8_1_29::Ais8_1_29(const char *nmea_payload, const size_t pad)
}

link_id = ubits(bs, 56, 10);
size_t text_bits = num_bits - 66;
size_t text_bits = ((num_bits - 66) / 6) * 6;
text = ais_str(bs, 66, text_bits);
const size_t spare2_bits = text_bits % 6;
const size_t spare2_bits = num_bits - 66 - text_bits;
if (spare2_bits) {
const size_t start = 66 + text_bits;
spare2 = ubits(bs, start, spare2_bits);
Expand Down

0 comments on commit 0eda416

Please sign in to comment.