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;
}
{
DWORD dwSize = 256 + 1;
char* retVal = new char[256];
- ASSERT(GetUserName ( retVal, &dwSize ));
+ // initialisaton
+ retVal[0]='\0';
+ ASSERT(GetUserName` ( retVal, &dwSize ));
return retVal;
}