Skip to content

Commit

Permalink
fix spare data loading
Browse files Browse the repository at this point in the history
AisBitset::ToUnsignedInt() has explicit assert that length is not greater than 32.
  • Loading branch information
rutsky authored and pyrog committed Nov 17, 2017
1 parent 903dc7c commit 84b077f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/libais/ais.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ class Ais6_1_5 : public Ais6 {
bool ai_available; // TODO(schwehr): AI? Is this the dac/fi being acked?
int ai_response;
int spare;
int spare2;

Ais6_1_5(const char *nmea_payload, const size_t pad);
};
Expand Down
3 changes: 2 additions & 1 deletion src/libais/ais6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ Ais6_1_5::Ais6_1_5(const char *nmea_payload, const size_t pad)
seq_num = bs.ToUnsignedInt(104, 11);
ai_available = static_cast<bool>(bs[115]);
ai_response = bs.ToUnsignedInt(116, 3);
spare = bs.ToUnsignedInt(119, 49);
spare = bs.ToUnsignedInt(119, 32);
spare2 = bs.ToUnsignedInt(151, 17);

assert(bs.GetRemaining() == 0);

Expand Down

0 comments on commit 84b077f

Please sign in to comment.