PcapPacketReader pr(argv[1]);
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic): it's argv..
auto filePtr = pdns::openFileForWriting(argv[2], 0600, true, false);
if (!filePtr) {
auto error = errno;
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic): it's argv..
cerr<<"Error opening output file "<<argv[2]<<": "<<stringerror(error)<<endl;
exit(EXIT_FAILURE);
}
return;
}
- auto filePtr = reinterpret_cast<FILE*>(SSL_CTX_get_ex_data(sslCtx, s_keyLogIndex));
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast): OpenSSL's API
+ auto* filePtr = reinterpret_cast<FILE*>(SSL_CTX_get_ex_data(sslCtx, s_keyLogIndex));
if (filePtr == nullptr) {
return;
}
}
int fileDesc = open(filePath.c_str(), flags, permissions);
if (fileDesc == -1) {
- return UniqueFilePtr(nullptr);
+ return {};
}
auto filePtr = pdns::UniqueFilePtr(fdopen(fileDesc, appendIfExists ? "a" : "w"));
if (!filePtr) {
auto error = errno;
close(fileDesc);
errno = error;
- return UniqueFilePtr(nullptr);
+ return {};
}
return filePtr;
}