aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-30 18:44:40 +0200
committerMax Kellermann <max@duempel.org>2014-07-30 18:44:40 +0200
commit664fc76ac7bf3d3d459d813e8ac8acc5cf523808 (patch)
tree3bfb84fc45e7e595b27389cf25144d58c895488b
parent37d6cc07a7a09845be53fcd2edf7697375d9a2ff (diff)
downloadmpd-664fc76ac7bf3d3d459d813e8ac8acc5cf523808.tar.gz
mpd-664fc76ac7bf3d3d459d813e8ac8acc5cf523808.tar.xz
mpd-664fc76ac7bf3d3d459d813e8ac8acc5cf523808.zip
system/Resolver: use nullptr instead of NULL
-rw-r--r--src/system/Resolver.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/system/Resolver.cxx b/src/system/Resolver.cxx
index 910e1629c..a94217bac 100644
--- a/src/system/Resolver.cxx
+++ b/src/system/Resolver.cxx
@@ -85,7 +85,7 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length)
return "unknown";
#ifdef HAVE_IPV6
- if (strchr(host, ':') != NULL) {
+ if (strchr(host, ':') != nullptr) {
std::string result("[");
result.append(host);
result.append("]:");
@@ -121,7 +121,7 @@ resolve_host_port(const char *host_port, unsigned default_port,
}
}
- if (port == NULL) {
+ if (port == nullptr) {
/* port is after the colon, but only if it's the only
colon (don't split IPv6 addresses) */
@@ -134,13 +134,13 @@ resolve_host_port(const char *host_port, unsigned default_port,
}
char buffer[32];
- if (port == NULL && default_port != 0) {
+ if (port == nullptr && default_port != 0) {
snprintf(buffer, sizeof(buffer), "%u", default_port);
port = buffer;
}
if ((flags & AI_PASSIVE) != 0 && strcmp(host, "*") == 0)
- host = NULL;
+ host = nullptr;
addrinfo hints;
memset(&hints, 0, sizeof(hints));
@@ -154,7 +154,7 @@ resolve_host_port(const char *host_port, unsigned default_port,
error.Format(resolver_domain, ret,
"Failed to look up '%s': %s",
host_port, gai_strerror(ret));
- return NULL;
+ return nullptr;
}
return ai;