]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
initialisation of variables
authorptv <ptv@opencascade.com>
Fri, 30 Jun 2006 09:00:20 +0000 (09:00 +0000)
committerptv <ptv@opencascade.com>
Fri, 30 Jun 2006 09:00:20 +0000 (09:00 +0000)
src/Utils/Utils_Identity.cxx

index 661cebbccab42b0aeea047ca750f687218faffa3..5fc40ae1aac3bc56cade1289db0bb4608cedf5cc 100644 (file)
@@ -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;
 }