code cleanup based on cppcheck results

This commit is contained in:
Mark Vejvoda
2013-05-17 03:59:34 +00:00
parent 0c9679b8b2
commit 8408526b12
31 changed files with 85 additions and 117 deletions

View File

@@ -668,7 +668,6 @@ std::vector<std::string> Socket::getLocalIPAddressList() {
/* get my host name */
char myhostname[101]="";
gethostname(myhostname,100);
char myhostaddr[101] = "";
struct hostent* myhostent = gethostbyname(myhostname);
if(myhostent) {
@@ -733,6 +732,7 @@ std::vector<std::string> Socket::getLocalIPAddressList() {
struct sockaddr_in *pSockAddr = (struct sockaddr_in *)&ifr.ifr_addr;
if(pSockAddr != NULL) {
char myhostaddr[101] = "";
Ip::Inet_NtoA(SockAddrToUint32(&pSockAddr->sin_addr), myhostaddr);
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] szBuf [%s], myhostaddr = [%s], ifr.ifr_flags = %d, ifrA.ifr_flags = %d, ifr.ifr_name [%s]\n",__FILE__,__FUNCTION__,__LINE__,szBuf,myhostaddr,ifr.ifr_flags,ifrA.ifr_flags,ifr.ifr_name);