1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-11 15:49:38 +00:00

Avoid overrun on empty file.

This commit is contained in:
Thomas Harte 2024-12-06 13:37:06 -05:00
parent 19f815eeff
commit e8aa9b9eb2

View File

@ -80,6 +80,11 @@ std::optional<BASICAnalysis> analyse(const File &file) {
return analysis;
}
// Don't form an opinion if file is empty.
if(file.data.empty()) {
return std::nullopt;
}
uint16_t line_address = file.starting_address;
int previous_line_number = -1;