From 6e9208efcd6c7cea6ec734efad070045c6e7fa9c Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 3 Apr 2018 03:20:08 +0000 Subject: [PATCH] Simplify test for corrupt IFF file clang rightly warns for `if (!var&1)`, which parses as `if (!(var & 1))`, which is probably not what the original author intended. Unfortunately, the author never commented what *was* intended. The author might have meant to reject any row with an even length (`if (!(var & 1))`, but that seems strange in this context. Remove the `& 1`, which retains the sense of what the code has always done. --- similar/main/iff.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/similar/main/iff.cpp b/similar/main/iff.cpp index e9736f78a..f502b6813 100644 --- a/similar/main/iff.cpp +++ b/similar/main/iff.cpp @@ -314,7 +314,7 @@ static int parse_delta(PHYSFS_File *ifile,long len,iff_bitmap_header *bmheader) } if (cnt == -1) { - if (!bmheader->w&1) + if (!bmheader->w) return IFF_CORRUPT; } else if (cnt)