From 5c5d3e4c260b024c9cde11bc024edbec4b9603f5 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 19 Jan 2018 18:35:23 -0500 Subject: Clear Coverity finding CID 186948 "Logically dead code" --- validat1.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'validat1.cpp') diff --git a/validat1.cpp b/validat1.cpp index 9b1bd8e3..b3abc879 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -3262,7 +3262,7 @@ bool ValidateEncoder() // string of '*'. To round trip a string both IsolatedInitialize // must be called and work correctly. std::cout << "\nCustom encoder validation running...\n\n"; - bool pass1 = true, pass2 = false; + bool pass = true; int lookup[256]; const char alphabet[64+1] = @@ -3292,10 +3292,10 @@ bool ValidateEncoder() decoder.Put((const byte*) str1.data(), str1.size()); decoder.MessageEnd(); - pass1 = (str1 == std::string(expected)) && pass1; - pass1 = (str2 == std::string(alphabet, 64)) && pass1; + pass = (str1 == std::string(expected)) && pass; + pass = (str2 == std::string(alphabet, 64)) && pass; - std::cout << (pass1 ? "passed:" : "FAILED:"); + std::cout << (pass ? "passed:" : "FAILED:"); std::cout << " Encode and decode\n"; // Try forcing an empty message. This is the Monero bug @@ -3315,14 +3315,11 @@ bool ValidateEncoder() volatile lword size = decoder2.MaxRetrievable(); lword shadow = size; CRYPTOPP_UNUSED(shadow); - - pass2 = true; } - std::cout << (pass2 ? "passed:" : "FAILED:"); - std::cout << " 0-length message\n"; + std::cout << "passed: 0-length message\n"; - return pass1 && pass2; + return pass; } bool ValidateSHACAL2() -- cgit v1.2.1