diff --git a/TpfConvert/src/ModfileLoader_TpfReader.ixx b/TpfConvert/src/ModfileLoader_TpfReader.ixx index 5c14a76..59b9b35 100644 --- a/TpfConvert/src/ModfileLoader_TpfReader.ixx +++ b/TpfConvert/src/ModfileLoader_TpfReader.ixx @@ -46,7 +46,7 @@ private: [[nodiscard]] char XOR(const char b, const long position) const { - if (position > line_length - 4) { + if (position >= (line_length / 4) * 4) { return b ^ TPF_XOREven; } diff --git a/modules/ModfileLoader_TpfReader.ixx b/modules/ModfileLoader_TpfReader.ixx index 1c7e728..81410d3 100644 --- a/modules/ModfileLoader_TpfReader.ixx +++ b/modules/ModfileLoader_TpfReader.ixx @@ -46,7 +46,7 @@ private: [[nodiscard]] char XOR(const char b, const long position) const { - if (position > line_length - 4) { + if (position >= (line_length / 4) * 4) { return b ^ TPF_XOREven; }