Skip to content

Commit

Permalink
bit of tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Habbie committed Sep 6, 2024
1 parent b063493 commit 03e665d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pdns/lua-record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -969,18 +969,19 @@ static void setupLuaRecords(LuaContext& lua) // NOLINT(readability-function-cogn
if(parts.size()==8) {
string tot;
for(int i=0; i<8; ++i) {
if(i)
if(i != 0) {
tot.append(1,':');
}
tot+=parts[i];
}
ComboAddress ca(tot);
return ca.toString();
ComboAddress address(tot);
return address.toString();
}
else if(parts.size()==1) {
if (parts[0].find('-') != std::string::npos) {
boost::replace_all(parts[0],"-",":");
ComboAddress ca(parts[0]);
return ca.toString();
ComboAddress address(parts[0]);
return address.toString();
} else {
if (parts[0].size() >= 32) {
auto ippart = parts[0].substr(parts[0].size()-32);
Expand All @@ -994,8 +995,8 @@ static void setupLuaRecords(LuaContext& lua) // NOLINT(readability-function-cogn
ippart.substr(24, 4) + ":" +
ippart.substr(28, 4);

ComboAddress ca(fulladdress);
return ca.toString();
ComboAddress address(fulladdress);
return address.toString();
}
}
}
Expand Down

0 comments on commit 03e665d

Please sign in to comment.