mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 11:44:31 +00:00
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:
parent
acc20844cd
commit
22430fb8d4
@ -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"))) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user