From 7df2cd1e64dc5d35d22b4f2c1ff2edd9d111518a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 10 Apr 2026 12:34:13 -0400 Subject: [PATCH] Fix length test. --- Analyser/Static/Thomson/StaticAnalyser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Analyser/Static/Thomson/StaticAnalyser.cpp b/Analyser/Static/Thomson/StaticAnalyser.cpp index 469822a9d..0948fee26 100644 --- a/Analyser/Static/Thomson/StaticAnalyser.cpp +++ b/Analyser/Static/Thomson/StaticAnalyser.cpp @@ -34,8 +34,9 @@ Analyser::Static::TargetList Analyser::Static::Thomson::GetTargets( // Cf. https://pulkomandy.tk/wiki/doku.php?id=documentations:monitor:tape.format for leader block format; // my parser provides block type separately and length implicitly so the type at offset 0xd is at 0xb // in ->data. - if(!first->type && first->data.size() >= 11) { - if(!first->data[0xb]) { // File type; 0 = BASIC, 1 = DATA; 2 = binary. + static constexpr size_t TypeOffset = 0xb; + if(!first->type && first->data.size() > TypeOffset) { + if(!first->data[TypeOffset]) { // File type; 0 = BASIC, 1 = DATA; 2 = binary. target->loading_command = "RUN\"\n"; } else { target->loading_command = "LOADM\"\",,R\n";