LibCore: Fix up type mistakes in Stream::read_trivial_value

This commit is contained in:
Tim Schumacher 2023-01-14 20:16:31 +01:00 committed by Tim Flynn
parent 3b824ec8c9
commit 6777cb0975
Notes: sideshowbarker 2024-07-17 08:45:34 +09:00

View file

@ -113,8 +113,8 @@ public:
ErrorOr<T> read_trivial_value()
{
alignas(T) u8 buffer[sizeof(T)] = {};
TRY(read_entire_buffer(buffer));
return *bit_cast<T>(buffer);
TRY(read_entire_buffer({ &buffer, sizeof(buffer) }));
return bit_cast<T>(buffer);
}
template<typename T>