AK: Cast pointer in FixedMemoryStream::read_in_place(count)

I didn't notice this before because I only ever called it with u8. Oops!
This commit is contained in:
Sam Atkins 2023-11-01 14:56:32 +00:00 committed by Andreas Kling
parent 89b35c6dc8
commit 1519290989

View file

@ -64,7 +64,7 @@ public:
return Error::from_string_view_or_print_error_and_return_errno("Tried to obtain a non-const span from a read-only FixedMemoryStream"sv, EINVAL);
}
Span<T> span { m_bytes.offset_pointer(m_offset), count };
Span<T> span { reinterpret_cast<T*>(m_bytes.offset_pointer(m_offset)), count };
TRY(discard(sizeof(T) * count));
return span;
}