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 <[email protected]>

* Added suggestions

Signed-off-by: Alejandro Hernández Cordero <[email protected]>

---------

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
(cherry picked from commit 8258507)
  • Loading branch information
ahcorde authored and mergify[bot] committed Apr 18, 2024
1 parent 2101dbf commit 07ae7d6
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 @@ -118,14 +118,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 07ae7d6

Please sign in to comment.