diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index a3a072e0..2ba305c3 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -14,18 +14,22 @@ namespace nostalgia { /** - * Convert path references to inodes to save space + * Convert path references in Claw data to inodes to save space * @param buff buffer holding file * @return error * stub for now */ static ox::Result pathToInode(const ox::Buffer &buff) noexcept { - return ox::move(buff); + return std::move(buff); } // just strip header for now... static ox::Result toMetalClaw(const ox::Buffer &buff) noexcept { - return ox::stripClawHeader(buff.data(), buff.size()); + oxRequire(hdr, ox::readClawHeader(buff)); + if (hdr.fmt != ox::ClawFormat::Metal) { + return OxError(1, "Cannot convert from Claw to MetalClaw, data portion must already be MetalClaw"); + } + return ox::stripClawHeader(buff); } static ox::Error doTransformations(ox::FileSystem *dest, const ox::String &filePath) noexcept {