From: Otto Moerbeek Date: Tue, 11 Feb 2025 13:06:27 +0000 (+0100) Subject: clang-tidy X-Git-Tag: dnsdist-2.0.0-alpha1~109^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75acdf42c0ace9fb2437a587cf717a8b959fcfb8;p=thirdparty%2Fpdns.git clang-tidy --- diff --git a/pdns/sdig.cc b/pdns/sdig.cc index ca956a0c34..291b3f1a38 100644 --- a/pdns/sdig.cc +++ b/pdns/sdig.cc @@ -63,8 +63,8 @@ static void fillPacket(vector& 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); @@ -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}; @@ -246,6 +246,7 @@ try { bool dumpluaraw = false; std::optional 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(); @@ -353,6 +354,7 @@ try { } } } + // NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic, concurrency-mt-unsafe) if (dot) { tcp = true;