setArgPrefix("geoip" + suffix);
if (getArg("dnssec-keydir").empty() == false) {
DIR* d = opendir(getArg("dnssec-keydir").c_str());
- if (d == NULL) {
+ if (d == nullptr) {
throw PDNSException("dnssec-keydir " + getArg("dnssec-keydir") + " does not exist");
}
d_dnssec = true;
}
Netmask addr{"0.0.0.0/0"};
- if (pkt_p != NULL)
+ if (pkt_p != nullptr)
addr = Netmask(pkt_p->getRealRemote());
gl.netmask = 0;
return; // no hit
const NetmaskTree<vector<string>>::node_type* node = target->second.masks.lookup(addr);
- if (node == NULL)
+ if (node == nullptr)
return; // no hit, again.
DNSName sformat;
string::size_type cur, last;
boost::optional<int> alt, prec;
double lat, lon;
- time_t t = time((time_t*)NULL);
+ time_t t = time(nullptr);
GeoIPNetmask tmp_gl; // largest wins
struct tm gtm;
gmtime_r(&t, >m);
ostringstream pathname;
pathname << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "*.key";
glob_t glob_result;
- if (glob(pathname.str().c_str(), GLOB_ERR, NULL, &glob_result) == 0) {
+ if (glob(pathname.str().c_str(), GLOB_ERR, nullptr, &glob_result) == 0) {
for (size_t i = 0; i < glob_result.gl_pathc; i++) {
if (regexec(®, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
DNSBackend::KeyData kd;
ostringstream pathname;
pathname << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "*.key";
glob_t glob_result;
- if (glob(pathname.str().c_str(), GLOB_ERR, NULL, &glob_result) == 0) {
+ if (glob(pathname.str().c_str(), GLOB_ERR, nullptr, &glob_result) == 0) {
for (size_t i = 0; i < glob_result.gl_pathc; i++) {
if (regexec(®, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
ostringstream pathname;
pathname << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "*.key";
glob_t glob_result;
- if (glob(pathname.str().c_str(), GLOB_ERR, NULL, &glob_result) == 0) {
+ if (glob(pathname.str().c_str(), GLOB_ERR, nullptr, &glob_result) == 0) {
for (size_t i = 0; i < glob_result.gl_pathc; i++) {
if (regexec(®, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
ostringstream pathname;
pathname << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "*.key";
glob_t glob_result;
- if (glob(pathname.str().c_str(), GLOB_ERR, NULL, &glob_result) == 0) {
+ if (glob(pathname.str().c_str(), GLOB_ERR, nullptr, &glob_result) == 0) {
for (size_t i = 0; i < glob_result.gl_pathc; i++) {
if (regexec(®, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
ostringstream pathname;
pathname << getArg("dnssec-keydir") << "/" << dom.domain.toStringNoDot() << "*.key";
glob_t glob_result;
- if (glob(pathname.str().c_str(), GLOB_ERR, NULL, &glob_result) == 0) {
+ if (glob(pathname.str().c_str(), GLOB_ERR, nullptr, &glob_result) == 0) {
for (size_t i = 0; i < glob_result.gl_pathc; i++) {
if (regexec(®, glob_result.gl_pathv[i], 5, regm, 0) == 0) {
auto kid = pdns::checked_stoi<unsigned int>(glob_result.gl_pathv[i] + regm[3].rm_so);
ostringstream pathname;
pathname << getArg("dnssec-keydir") << "/" << name.toStringNoDot() << "*.key";
glob_t glob_result;
- if (glob(pathname.str().c_str(), GLOB_ERR, NULL, &glob_result) == 0) {
+ if (glob(pathname.str().c_str(), GLOB_ERR, nullptr, &glob_result) == 0) {
globfree(&glob_result);
return true;
}