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
This commit is contained in:
Mark Thompson 2023-05-15 02:11:56 -05:00 committed by GitHub
parent acc20844cd
commit 22430fb8d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"))) {