From 6f4b869fa21dc03b53a387daa7bb38d9a445f7ac Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 3 Jun 2023 15:37:09 -0500 Subject: [PATCH] [keel] Fix string comparison bug in K1 header check --- src/keel/asset.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keel/asset.cpp b/src/keel/asset.cpp index 913f66af..a698d257 100644 --- a/src/keel/asset.cpp +++ b/src/keel/asset.cpp @@ -12,11 +12,11 @@ ox::Result readUuidHeader(const ox::Buffer &buff) noexcept { ox::Result readUuidHeader(const char *buff, std::size_t buffLen) noexcept { if (buffLen < K1HdrSz) { - return OxError(1, "Insufficient data to contain complete Nostalgia header"); + return OxError(1, "Insufficient data to contain complete Keel header"); } constexpr ox::StringView k1Hdr = "K1;"; - if (k1Hdr == buff) { - return OxError(2, "No Nostalgia asset header data"); + if (k1Hdr != ox::StringView(buff, k1Hdr.bytes())) { + return OxError(2, "No Keel asset header data"); } return ox::UUID::fromString(ox::StringView(buff + k1Hdr.bytes(), 36)); }