From f5803beb8a7313e3a9c3b01b0e418a407fa0801e Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 8 Oct 2004 15:37:34 +0000 Subject: [PATCH] use less than full length of buffer with gethostname in case there are errors in the implementation of gethostname --- src/ca/localHostName.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) ); }