BinaryIo: fix Reader::readValue().

std::fread() returns how many things it read, not the amount of
bytes read. Worst thing is, I got this right everywhere else.
This commit is contained in:
Guillaume Jacquemin 2024-03-25 12:02:12 +01:00
parent c9ac1ad4c8
commit 04e99d4953
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A

View file

@ -61,7 +61,7 @@ class Reader {
template<typename T> template<typename T>
bool readValue(T& value) { bool readValue(T& value) {
return fread(&value, sizeof(T), 1, _file) == sizeof(T); return fread(&value, sizeof(T), 1, _file) == 1;
} }
template<std::size_t S> template<std::size_t S>