Initializes the length of machine name properly.

This fix was suggested at (thanks!)

http://code.google.com/p/google-glog/issues/detail?id=9


git-svn-id: https://google-glog.googlecode.com/svn/trunk@62 eb4d4688-79bd-11dd-afb4-1d65580434c0
This commit is contained in:
2009-07-29 07:34:28 +00:00
parent 2c28a49394
commit b35305f1ab

View File

@ -177,8 +177,8 @@ static void GetHostName(string* hostname) {
}
*hostname = buf.nodename;
#elif defined(OS_WINDOWS)
char buf[256];
DWORD len;
char buf[MAX_COMPUTERNAME_LENGTH + 1];
DWORD len = MAX_COMPUTERNAME_LENGTH + 1;
if (GetComputerNameA(buf, &len)) {
*hostname = buf;
} else {