From: ptv Date: Fri, 30 Jun 2006 09:00:20 +0000 (+0000) Subject: initialisation of variables X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ae6a38a1fa632b1490f6092ac9700d17cb2343d1;p=modules%2Fkernel.git initialisation of variables --- diff --git a/src/Utils/Utils_Identity.cxx b/src/Utils/Utils_Identity.cxx index 661cebbcc..5fc40ae1a 100644 --- a/src/Utils/Utils_Identity.cxx +++ b/src/Utils/Utils_Identity.cxx @@ -83,8 +83,10 @@ const char* duplicate( const char *const str ) ; const char* get_uname( void ) { - char* hostName = new char[256]; - DWORD nSize = 256; + char* hostName = new char[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD nSize = MAX_COMPUTERNAME_LENGTH; + // initialisaton + hostName[0]='\0'; ASSERT(GetComputerName(hostName, &nSize)); return hostName; } @@ -98,7 +100,9 @@ const char* const get_pwname( void ) { DWORD dwSize = 256 + 1; char* retVal = new char[256]; - ASSERT(GetUserName ( retVal, &dwSize )); + // initialisaton + retVal[0]='\0'; + ASSERT(GetUserName` ( retVal, &dwSize )); return retVal; }