From 08ce270e069c1a96ff9178d9948e8a2adae072fd Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Mon, 8 Aug 2022 10:35:41 +0100 Subject: [PATCH] Minor tweak to header loading --- source/interpreter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/interpreter.c b/source/interpreter.c index 5f6d7de..b557e47 100644 --- a/source/interpreter.c +++ b/source/interpreter.c @@ -298,14 +298,17 @@ void runInterpreter(Interpreter* interpreter) { const unsigned char major = readByte(interpreter->bytecode, &interpreter->count); const unsigned char minor = readByte(interpreter->bytecode, &interpreter->count); const unsigned char patch = readByte(interpreter->bytecode, &interpreter->count); - const char* build = readString(interpreter->bytecode, &interpreter->count); if (command.verbose) { if (major != TOY_VERSION_MAJOR || minor != TOY_VERSION_MINOR || patch != TOY_VERSION_PATCH) { printf("Warning: interpreter/bytecode version mismatch\n"); } + } - if (!strncmp(build, TOY_VERSION_BUILD, strlen(TOY_VERSION_BUILD))) { + const char* build = readString(interpreter->bytecode, &interpreter->count); + + if (command.verbose) { + if (strncmp(build, TOY_VERSION_BUILD, strlen(TOY_VERSION_BUILD))) { printf("Warning: interpreter/bytecode build mismatch\n"); } }