From 2d5497fa07a25a7d37b0b89242b0bf2a5e1b59c4 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 26 Sep 2008 22:19:59 +0000 Subject: [PATCH] workaround for legacy vxWorks compiler bug check --- src/ca/hostNameCache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ca/hostNameCache.cpp b/src/ca/hostNameCache.cpp index baaca7f66..c3d105c06 100644 --- a/src/ca/hostNameCache.cpp +++ b/src/ca/hostNameCache.cpp @@ -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;