From 20f9040b425e483b4fb0149985f047a667e7239b Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Tue, 11 Feb 2014 19:46:18 -0800 Subject: [PATCH] Fix possible ununitialized but used variables --- src/comm/MAVLinkSimulationLink.cc | 3 +++ src/ui/configuration/FlightModeConfig.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index 9545abc73..35c06b260 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -677,6 +677,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) int streampointer = 0; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; int bufferlength = 0; + + // Initialize drop count to 0 so it isn't referenced uninitialized when returned at the bottom of this function + comm.packet_rx_drop_count = 0; // Output all bytes as hex digits for (int i=0; i