Skip to content

Commit

Permalink
Don't pass result of void function to string constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-henry committed Mar 5, 2024
1 parent 80cfc2b commit b9d0cf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions controller/EmbeddedNetworkController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,14 @@ static bool _parseRule(json &r,ZT_VirtualNetworkRule &rule)
return true;
} else if (t == "MATCH_MAC_SOURCE") {
rule.t |= ZT_NETWORK_RULE_MATCH_MAC_SOURCE;
const std::string mac(Utils::cleanMac(OSUtils::jsonString(r["mac"],"0")));
std::string mac(OSUtils::jsonString(r["mac"],"0"));
Utils::cleanMac(mac);
Utils::unhex(mac.c_str(),(unsigned int)mac.length(),rule.v.mac,6);
return true;
} else if (t == "MATCH_MAC_DEST") {
rule.t |= ZT_NETWORK_RULE_MATCH_MAC_DEST;
const std::string mac(Utils::cleanMac(OSUtils::jsonString(r["mac"],"0")));
std::string mac(OSUtils::jsonString(r["mac"],"0"));
Utils::cleanMac(mac);
Utils::unhex(mac.c_str(),(unsigned int)mac.length(),rule.v.mac,6);
return true;
} else if (t == "MATCH_IPV4_SOURCE") {
Expand Down

0 comments on commit b9d0cf9

Please sign in to comment.