net/Resolver: use StringIsEqual()

This commit is contained in:
Max Kellermann 2024-09-04 17:26:45 +02:00
parent 32dd9704ce
commit 9ff8e02e54
1 changed files with 2 additions and 3 deletions

View File

@ -7,6 +7,7 @@
#include "HostParser.hxx" #include "HostParser.hxx"
#include "lib/fmt/RuntimeError.hxx" #include "lib/fmt/RuntimeError.hxx"
#include "util/CharUtil.hxx" #include "util/CharUtil.hxx"
#include "util/StringAPI.hxx"
#ifdef _WIN32 #ifdef _WIN32
#include <ws2tcpip.h> #include <ws2tcpip.h>
@ -16,8 +17,6 @@
#include <net/if.h> #include <net/if.h>
#endif #endif
#include <cstring>
#include <stdio.h> #include <stdio.h>
AddressInfoList AddressInfoList
@ -107,7 +106,7 @@ Resolve(const char *host_and_port, int default_port,
} else } else
throw std::runtime_error("Garbage after host name"); throw std::runtime_error("Garbage after host name");
if (ai_is_passive(hints) && strcmp(host, "*") == 0) if (ai_is_passive(hints) && StringIsEqual(host, "*"))
host = nullptr; host = nullptr;
} else { } else {
host = nullptr; host = nullptr;