mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-16 15:10:35 +08:00
Fix uninitialized values identified by cppcheck
* Replace `malloc` by `calloc` for c-string initialization * Add initializer braces for structs
This commit is contained in:
committed by
Lorenz Meier
parent
7cf2a49948
commit
40dff737c5
@@ -317,7 +317,7 @@ int uORBTest::UnitTest::test_multi()
|
||||
/* this routine tests the multi-topic support */
|
||||
test_note("try multi-topic support");
|
||||
|
||||
struct orb_test t, u;
|
||||
struct orb_test t {}, u {};
|
||||
t.val = 0;
|
||||
int instance0;
|
||||
_pfd[0] = orb_advertise_multi(ORB_ID(orb_multitest), &t, &instance0, ORB_PRIO_MAX);
|
||||
@@ -536,7 +536,7 @@ int uORBTest::UnitTest::test_multi_reversed()
|
||||
return test_fail("sub. id2: ret: %d", sfd2);
|
||||
}
|
||||
|
||||
struct orb_test t, u;
|
||||
struct orb_test t {}, u {};
|
||||
|
||||
t.val = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user