Skip to content

Commit

Permalink
Try and fix the clearing an object of non-trivial type error
Browse files Browse the repository at this point in the history
  • Loading branch information
peternewman committed Mar 28, 2024
1 parent eab5997 commit 58ae321
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/acn/RPTInflatorTest.cpp
Expand Up @@ -60,7 +60,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(RPTInflatorTest);
*/
void RPTInflatorTest::testDecodeHeader() {
RPTHeader::rpt_pdu_header header;
memset(&header, 0, sizeof(header));
// Need to cast the header before we memset as it's got a constructor to
// ensure the reserved value is set to zero by default
memset(reinterpret_cast<uint8_t*>(&header), 0, sizeof(header));
RPTInflator inflator;
HeaderSet header_set, header_set2;
unsigned int bytes_used;
Expand Down

0 comments on commit 58ae321

Please sign in to comment.