Skip to content

Commit

Permalink
AK: Cast pointer in FixedMemoryStream::read_in_place(count)
Browse files Browse the repository at this point in the history
I didn't notice this before because I only ever called it with u8. Oops!
  • Loading branch information
AtkinsSJ authored and awesomekling committed Nov 8, 2023
1 parent 89b35c6 commit 1519290
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AK/MemoryStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FixedMemoryStream : public SeekableStream {
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;
}
Expand Down

0 comments on commit 1519290

Please sign in to comment.