From 04e99d49533d0cad64cf8c013103427953730001 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Mon, 25 Mar 2024 12:02:12 +0100 Subject: [PATCH] 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. --- src/BinaryIo/Reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BinaryIo/Reader.h b/src/BinaryIo/Reader.h index 794470f..6a00886 100644 --- a/src/BinaryIo/Reader.h +++ b/src/BinaryIo/Reader.h @@ -61,7 +61,7 @@ class Reader { template bool readValue(T& value) { - return fread(&value, sizeof(T), 1, _file) == sizeof(T); + return fread(&value, sizeof(T), 1, _file) == 1; } template