motor_test: prevent use of uninitialised test_motor orb handle

stack variables are not initialised to zero
This commit is contained in:
Andrew Tridgell
2014-11-20 09:52:50 +11:00
parent b830137ec8
commit ecc7a3cbb4
+2 -1
View File
@@ -59,9 +59,10 @@ __EXPORT int motor_test_main(int argc, char *argv[]);
static void motor_test(unsigned channel, float value);
static void usage(const char *reason);
static orb_advert_t _test_motor_pub;
void motor_test(unsigned channel, float value)
{
orb_advert_t _test_motor_pub;
struct test_motor_s _test_motor;
_test_motor.motor_number = channel;