From 22430fb8d49833d709a65da2339ec1edefb66339 Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Mon, 15 May 2023 02:11:56 -0500 Subject: [PATCH] Support frequency files that don't have a C/R at the end of the last line (#997) * Support FREQ files that don't have 0x0A at end of last line --- firmware/application/freqman.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/application/freqman.cpp b/firmware/application/freqman.cpp index c4c0db1db..5f826f3c0 100644 --- a/firmware/application/freqman.cpp +++ b/firmware/application/freqman.cpp @@ -146,6 +146,10 @@ bool load_freqman_file_ex(std::string& file_stem, freqman_db& db, bool load_freq // Reset line_start to beginning of buffer line_start = file_data; + // If EOF reached, insert 0x0A after, in case the last line doesn't have a C/R + if (read_size.value() < 256) + *(line_start + read_size.value()) = 0x0A; + // Look for complete lines in buffer while ((line_end = strstr(line_start, "\x0A"))) {