workaround for legacy vxWorks compiler bug check

This commit is contained in:
Jeff Hill
2008-09-26 22:19:59 +00:00
parent 32616ba5fa
commit 2d5497fa07

View File

@@ -56,8 +56,10 @@ void hostNameCache::transactionComplete ( const char * pHostNameIn )
// set the entrire string to nill terminators before we start copying
// in the name (this reduces the chance that another thread will see
// garbage characters).
size_t newNameLen = std :: min < size_t > (
strlen ( pHostNameIn ), sizeof ( this->hostNameBuf ) - 1u );
size_t newNameLen = strlen ( pHostNameIn );
if ( newNameLen > sizeof ( this->hostNameBuf ) - 1u ) {
newNameLen = sizeof ( this->hostNameBuf ) - 1u;
}
strncpy ( this->hostNameBuf, "", sizeof ( this->hostNameBuf ) );
strncpy ( this->hostNameBuf, pHostNameIn, sizeof ( this->hostNameBuf ) - 1 );
this->nameLength = newNameLen;