diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index e5d69e87..1bbb77b5 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -2332,7 +2332,7 @@ void ServerSocket::bind(int port) { snprintf(szBuf, 8096,"In [%s::%s] Error binding socket sock = " PLATFORM_SOCKET_FORMAT_TYPE ", address [%s] port = %d err = %d, error = %s opt_result = %d\n",__FILE__,__FUNCTION__,sock,this->bindSpecificAddress.c_str(),port,err,getLastSocketErrorFormattedText().c_str(),opt_result); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"%s",szBuf); - snprintf(szBuf, 8096,"Error binding socket sock = %d, address [%s] port = %d err = %d, error = %s\n",sock,this->bindSpecificAddress.c_str(),port,err,getLastSocketErrorFormattedText().c_str()); + snprintf(szBuf, 8096,"Error binding socket sock = " PLATFORM_SOCKET_FORMAT_TYPE ", address [%s] port = %d err = %d, error = %s\n",sock,this->bindSpecificAddress.c_str(),port,err,getLastSocketErrorFormattedText().c_str()); throw megaglest_runtime_error(szBuf); } portBound = true; @@ -2413,7 +2413,7 @@ Socket *ServerSocket::accept(bool errorOnFail) { if(isSocketValid(&newSock) == false) { char szBuf[8096]=""; - snprintf(szBuf, 8096,"In [%s::%s Line: %d] Error accepting socket connection sock = " PLATFORM_SOCKET_FORMAT_TYPE ", err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,sock,newSock,getLastSocketErrorFormattedText().c_str()); + snprintf(szBuf, 8096,"In [%s::%s Line: %d] Error accepting socket connection sock = " PLATFORM_SOCKET_FORMAT_TYPE ", err = " PLATFORM_SOCKET_FORMAT_TYPE ", error = %s\n",__FILE__,__FUNCTION__,__LINE__,sock,newSock,getLastSocketErrorFormattedText().c_str()); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] %s\n",__FILE__,__FUNCTION__,__LINE__,szBuf); int lastSocketError = getLastSocketError(); diff --git a/source/tests/shared_lib/xml/xml_parser_test.cpp b/source/tests/shared_lib/xml/xml_parser_test.cpp index ca94e4f3..8681c600 100644 --- a/source/tests/shared_lib/xml/xml_parser_test.cpp +++ b/source/tests/shared_lib/xml/xml_parser_test.cpp @@ -115,7 +115,7 @@ public: XmlNode *rootNode = XmlIo::getInstance().load(test_filename, std::map()); CPPUNIT_ASSERT( rootNode != NULL ); - CPPUNIT_ASSERT_EQUAL( string("menu"), rootNode->getName() ); + CPPUNIT_ASSERT_EQUAL( string("menu"), (rootNode != NULL ? rootNode->getName() : string("")) ); delete rootNode; } @@ -191,7 +191,7 @@ public: XmlNode *rootNode = XmlIoRapid::getInstance().load(test_filename, std::map()); CPPUNIT_ASSERT( rootNode != NULL ); - CPPUNIT_ASSERT_EQUAL( string("menu"), rootNode->getName() ); + CPPUNIT_ASSERT_EQUAL( string("menu"), (rootNode != NULL ? rootNode->getName() : string("")) ); delete rootNode; }