Skip to content

Commit

Permalink
Removed warning (#4693)
Browse files Browse the repository at this point in the history
* Removed warning

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>

* Added suggestions

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>

---------

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Apr 18, 2024
1 parent ea5af48 commit 8258507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cpp/fastdds/core/policy/ParameterList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ bool ParameterList::read_guid_from_cdr_msg(
fastrtps::rtps::GUID_t& guid)
{
bool valid = false;
uint16_t pid;
uint16_t plength;
uint16_t pid = 0;
uint16_t plength = 0;
while (msg.pos < msg.length)
{
valid = true;
valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, &pid);
valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, &plength);
if ((pid == PID_SENTINEL) || !valid)
if (!valid || (pid == PID_SENTINEL))
{
break;
}
Expand Down

0 comments on commit 8258507

Please sign in to comment.