From 2d1ddea3d00574d951d4da8602fcf89194c7415f Mon Sep 17 00:00:00 2001 From: Rick Brice Date: Wed, 21 Apr 2021 14:33:46 -0700 Subject: [PATCH] Fixes conditional logic --- src/ifcparse/IfcCharacterDecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcparse/IfcCharacterDecoder.cpp b/src/ifcparse/IfcCharacterDecoder.cpp index 0ad9cc787d..f4057ac481 100644 --- a/src/ifcparse/IfcCharacterDecoder.cpp +++ b/src/ifcparse/IfcCharacterDecoder.cpp @@ -317,7 +317,7 @@ IfcCharacterEncoder::operator std::string() { // Either 2 or 4 to uses \X2 or \X4 respectively. // Currently hardcoded to 4, but \X2 might be // sufficient for nearly all purposes. - const int num_bytes = (str.empty() || *std::max_element(str.begin(), str.end())) > 0xffff ? 4 : 2; + const int num_bytes = (str.empty() || (*std::max_element(str.begin(), str.end()) > 0xffff)) ? 4 : 2; const std::string num_bytes_str = std::string(1,num_bytes + 0x30); bool in_extended = false;