mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-01-28 19:24:18 +01:00
Merge pull request #844 from f1rmb/f1rmb_nullptr_vs_NULL_with_getaddrinfo
Fix missing NXDN Net config entry handling and wrong getaddrinfo() argument.
This commit is contained in:
commit
ee4461866c
2
Conf.cpp
2
Conf.cpp
|
|
@ -993,6 +993,8 @@ bool CConf::read()
|
|||
} else if (section == SECTION::NXDN_NETWORK) {
|
||||
if (::strcmp(key, "Enable") == 0)
|
||||
m_nxdnNetworkEnabled = ::atoi(value) == 1;
|
||||
else if (::strcmp(key, "Protocol") == 0)
|
||||
m_nxdnNetworkProtocol = value;
|
||||
else if (::strcmp(key, "LocalAddress") == 0)
|
||||
m_nxdnLocalAddress = value;
|
||||
else if (::strcmp(key, "LocalPort") == 0)
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ int CUDPSocket::lookup(const std::string& hostname, unsigned short port, sockadd
|
|||
/* Port is always digits, no needs to lookup service */
|
||||
hints.ai_flags |= AI_NUMERICSERV;
|
||||
|
||||
int err = ::getaddrinfo(hostname.empty() ? nullptr : hostname.c_str(), portstr.c_str(), &hints, &res);
|
||||
int err = ::getaddrinfo(hostname.empty() ? NULL : hostname.c_str(), portstr.c_str(), &hints, &res);
|
||||
if (err != 0) {
|
||||
sockaddr_in* paddr = (sockaddr_in*)&addr;
|
||||
::memset(paddr, 0x00U, address_length = sizeof(sockaddr_in));
|
||||
|
|
|
|||
Loading…
Reference in a new issue