From bc6f832b7d4fd5a4ac228f974ea7a02880301157 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Sun, 10 May 2020 22:08:36 +0200 Subject: [PATCH] Loop using correct length --- FMControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FMControl.cpp b/FMControl.cpp index c1d3fd0..a3a7528 100644 --- a/FMControl.cpp +++ b/FMControl.cpp @@ -62,7 +62,7 @@ bool CFMControl::writeModem(const unsigned char* data, unsigned int length) m_incomingRFAudio.getData(bufferData, bufferLength); // Unpack the serial data into float values. - for (unsigned int i = 0U; i < length; i += 3U) { + for (unsigned int i = 0U; i < bufferLength; i += 3U) { unsigned short sample1 = 0U; unsigned short sample2 = 0U; unsigned int MASK = 0x00000FFFU;