Skip to content

Commit

Permalink
clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Feb 11, 2025
1 parent 6aa1867 commit 75acdf4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pdns/sdig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ static void fillPacket(vector<uint8_t>& packet, const string& q, const string& t
{
DNSPacketWriter pw(packet, DNSName(q), DNSRecordContent::TypeToNumber(t), qclass, opcode);

if (dnssec || ednsnm || getenv("SDIGBUFSIZE") || cookie) {
char* sbuf = getenv("SDIGBUFSIZE");
if (dnssec || ednsnm || getenv("SDIGBUFSIZE") != nullptr || cookie) { // NOLINT(concurrency-mt-unsafe) we'resingle threaded
char* sbuf = getenv("SDIGBUFSIZE"); // NOLINT(concurrency-mt-unsafe) we'resingle threaded
int bufsize;
if (sbuf)
bufsize = atoi(sbuf);
Expand Down Expand Up @@ -222,7 +222,7 @@ static void printReply(const string& reply, bool showflags, bool hidesoadetails,
}
}

int main(int argc, char** argv)
int main(int argc, char** argv) // NOLINT(readability-function-cognitive-complexity) XXX FIXME
try {
/* default timeout of 10s */
struct timeval timeout{10,0};
Expand All @@ -246,6 +246,7 @@ try {
bool dumpluaraw = false;
std::optional<string> cookie;

// NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic, concurrency-mt-unsafe) it's the argv API and w're single-threaded
for (int i = 1; i < argc; i++) {
if ((string)argv[i] == "--help") {
usage();
Expand Down Expand Up @@ -353,6 +354,7 @@ try {
}
}
}
// NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic, concurrency-mt-unsafe)

if (dot) {
tcp = true;
Expand Down

0 comments on commit 75acdf4

Please sign in to comment.