Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
fixup! tlvf: swap returned value of getNextTlvLength()
Browse files Browse the repository at this point in the history
Method return type is uint16_t so return UINT16_MAX instead of -1
in case of error.
  • Loading branch information
mariomaz committed Mar 16, 2020
1 parent 3bfdde0 commit 20eee01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/tlvf/src/src/CmduMessageRx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ int CmduMessageRx::getNextTlvType() const

uint16_t CmduMessageRx::getNextTlvLength() const
{
if (!getCmduHeader())
return -1;
if (!getCmduHeader()) {
return UINT16_MAX;
}
sTlvHeader *tlv = reinterpret_cast<sTlvHeader *>(msg.prevClass()->getBuffPtr());

uint16_t tlv_length = tlv->length;
Expand Down

0 comments on commit 20eee01

Please sign in to comment.