diff --git a/src/ca/localHostName.cpp b/src/ca/localHostName.cpp index 69f473ea5..64210c88c 100644 --- a/src/ca/localHostName.cpp +++ b/src/ca/localHostName.cpp @@ -30,7 +30,7 @@ localHostName::localHostName () int status = osiSockAttach (); if ( status ) { this->attachedToSockLib = true; - status = gethostname ( this->cache, sizeof ( this->cache ) ); + status = gethostname ( this->cache, sizeof ( this->cache ) - 1 ); if ( status ) { strncpy ( this->cache, "", sizeof ( this->cache ) ); }