Fix network ports datatype (unsigned int -> unsigned short). UDPSocket: fix old bug using m_port instead of m_port[x].

This commit is contained in:
Daniel Caujolle-Bert 2021-04-25 07:43:56 +02:00
parent 183615d52e
commit 310cf0c8ff
No known key found for this signature in database
GPG key ID: 51AED7171EC00614
9 changed files with 34 additions and 33 deletions

View file

@ -145,11 +145,11 @@ bool CConf::read()
else if (::strcmp(key, "RptAddress") == 0)
m_rptAddress = value;
else if (::strcmp(key, "RptPort") == 0)
m_rptPort = (unsigned int)::atoi(value);
m_rptPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "LocalAddress") == 0)
m_myAddress = value;
else if (::strcmp(key, "LocalPort") == 0)
m_myPort = (unsigned int)::atoi(value);
m_myPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "Daemon") == 0)
m_daemon = ::atoi(value) == 1;
} else if (section == SECTION_LOG) {
@ -167,7 +167,7 @@ bool CConf::read()
if (::strcmp(key, "Address") == 0)
m_dapnetAddress = value;
else if (::strcmp(key, "Port") == 0)
m_dapnetPort = (unsigned int)::atoi(value);
m_dapnetPort = (unsigned short)::atoi(value);
else if (::strcmp(key, "AuthKey") == 0) {
for (unsigned int i = 0U; value[i] != '\0'; i++) {
if (!::isspace(value[i]))
@ -214,7 +214,7 @@ std::string CConf::getRptAddress() const
return m_rptAddress;
}
unsigned int CConf::getRptPort() const
unsigned short CConf::getRptPort() const
{
return m_rptPort;
}
@ -224,7 +224,7 @@ std::string CConf::getMyAddress() const
return m_myAddress;
}
unsigned int CConf::getMyPort() const
unsigned short CConf::getMyPort() const
{
return m_myPort;
}
@ -264,7 +264,7 @@ std::string CConf::getDAPNETAddress() const
return m_dapnetAddress;
}
unsigned int CConf::getDAPNETPort() const
unsigned short CConf::getDAPNETPort() const
{
return m_dapnetPort;
}