From 54a13b1c126ce9360520b51da5646e73ffff9d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 30 Oct 2022 14:01:47 +0100 Subject: [PATCH] Remove check for negative unsigned expression According to cppcheck's `unsignedLessThanZero` error: ``` src\engine\shared\datafile.cpp:129:13: style: Checking if unsigned expression 'Bytes' is less than zero. [unsignedLessThanZero] if(Bytes <= 0) ^ ``` --- src/engine/shared/datafile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/shared/datafile.cpp b/src/engine/shared/datafile.cpp index 08c5e1dac..c48703898 100644 --- a/src/engine/shared/datafile.cpp +++ b/src/engine/shared/datafile.cpp @@ -116,7 +116,7 @@ bool CDataFileReader::Open(class IStorage *pStorage, const char *pFilename, int while(true) { unsigned Bytes = io_read(File, aBuffer, BUFFER_SIZE); - if(Bytes <= 0) + if(Bytes == 0) break; Crc = crc32(Crc, aBuffer, Bytes); sha256_update(&Sha256Ctxt, aBuffer, Bytes);