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:
parent
2c28a49394
commit
b35305f1ab
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user