diff --git a/src/keel/media.cpp b/src/keel/media.cpp index 46a36d937..4af8cb0d6 100644 --- a/src/keel/media.cpp +++ b/src/keel/media.cpp @@ -178,9 +178,8 @@ ox::Error setRomFs(Context &ctx, ox::UPtr fs) noexcept { } ox::Result> loadRomFs(ox::CRStringView path) noexcept { - const auto lastDot = ox_lastIndexOf(path, '.'); - const auto fsExt = lastDot != -1 ? substr(path, static_cast(lastDot)) : ""; - if (ox_strcmp(fsExt, ".oxfs") == 0) { + auto const lastDot = ox::lastIndexOf(path, '.'); + if (!lastDot.error && substr(path, lastDot.value) == ".oxfs") { oxRequire(rom, loadRom(path)); return {ox::make_unique(rom, 32 * ox::units::MB, unloadRom)}; } else {