From 3f00280628c5ef364ae554d5474c7336effbba76 Mon Sep 17 00:00:00 2001 From: BLash Date: Tue, 16 Jul 2024 16:18:22 -0500 Subject: [PATCH] AP_ExternalAHRS_VectorNav: Move allocation to local scope Move receive_buf to method scope allocation rather than class scope --- libraries/SITL/SIM_VectorNav.cpp | 1 + libraries/SITL/SIM_VectorNav.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/SITL/SIM_VectorNav.cpp b/libraries/SITL/SIM_VectorNav.cpp index 09bce92994..ed4c1bcaed 100644 --- a/libraries/SITL/SIM_VectorNav.cpp +++ b/libraries/SITL/SIM_VectorNav.cpp @@ -213,6 +213,7 @@ void VectorNav::update(void) send_packet2(); } + char receive_buf[50]; const ssize_t n = read_from_autopilot(&receive_buf[0], ARRAY_SIZE(receive_buf)); if (n > 0) { if (strncmp(receive_buf, "$VNRRG,01", 9) == 0) { diff --git a/libraries/SITL/SIM_VectorNav.h b/libraries/SITL/SIM_VectorNav.h index b9f7e3962d..589539e5d9 100644 --- a/libraries/SITL/SIM_VectorNav.h +++ b/libraries/SITL/SIM_VectorNav.h @@ -45,8 +45,6 @@ private: uint32_t last_pkt2_us; uint32_t last_type_us; - char receive_buf[50]; - void send_packet1(); void send_packet2(); void nmea_printf(const char *fmt, ...);