diff --git a/lib/rlib/ar_wad.cpp b/lib/rlib/ar_wad.cpp index 31adb59..19ffe50 100644 --- a/lib/rlib/ar_wad.cpp +++ b/lib/rlib/ar_wad.cpp @@ -70,7 +70,7 @@ auto Ar::process_try_wad(IO const& io, offset_cb cb, Entry const& top_entry) con #define read_header($V) \ do { \ WAD::Header::V##$V v_header = {}; \ - rlib_assert(top_entry.size >= sizeof(header)); \ + rlib_assert(top_entry.size >= sizeof(v_header)); \ io.read(top_entry.offset, {(char*)&v_header, sizeof(v_header)}); \ header.desc_size = v_header.desc_size; \ header.desc_count = v_header.desc_count; \ @@ -89,7 +89,7 @@ auto Ar::process_try_wad(IO const& io, offset_cb cb, Entry const& top_entry) con break; #undef read_header default: - return "Unknown Ar::WAD version"; + rlib_assert(!"Unknown Ar::WAD version"); } rlib_assert(top_entry.size >= header.toc_start); rlib_assert(top_entry.size - header.toc_start >= header.toc_size); diff --git a/lib/rlib/ar_wpk.cpp b/lib/rlib/ar_wpk.cpp index 97a5aed..750e54e 100644 --- a/lib/rlib/ar_wpk.cpp +++ b/lib/rlib/ar_wpk.cpp @@ -46,7 +46,7 @@ auto Ar::process_try_wpk(IO const& io, offset_cb cb, Entry const& top_entry) con #define read_header($V) \ do { \ WPK::Header::V##$V v_header = {}; \ - rlib_assert(top_entry.size >= sizeof(header)); \ + rlib_assert(top_entry.size >= sizeof(v_header)); \ io.read(top_entry.offset, {(char*)&v_header, sizeof(v_header)}); \ header.desc_count = v_header.desc_count; \ header.toc_start = v_header.toc_start; \ @@ -57,7 +57,7 @@ auto Ar::process_try_wpk(IO const& io, offset_cb cb, Entry const& top_entry) con break; #undef read_header default: - return "Unsuported Ar::WPK version!"; + rlib_assert(!"Unsuported Ar::WPK version!"); } rlib_assert(top_entry.size >= header.toc_start);