diff options
author | <shinichiro.hamaji@gmail.com> | 2009-07-29 07:34:28 +0000 |
---|---|---|
committer | <shinichiro.hamaji@gmail.com> | 2009-07-29 07:34:28 +0000 |
commit | b35305f1ab1450b5d8abac0a21e9dc2f1c7e0b30 (patch) | |
tree | de8b0dfa7b3d1d9001cc500dca73d411a2515a16 /src/logging.cc | |
parent | 2c28a49394735342cb4695cb5bd531676fdb129b (diff) | |
download | glog-b35305f1ab1450b5d8abac0a21e9dc2f1c7e0b30.tar.gz glog-b35305f1ab1450b5d8abac0a21e9dc2f1c7e0b30.tar.bz2 glog-b35305f1ab1450b5d8abac0a21e9dc2f1c7e0b30.zip |
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
Diffstat (limited to 'src/logging.cc')
-rw-r--r-- | src/logging.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/logging.cc b/src/logging.cc index 25e9a86..1c39c35 100644 --- a/src/logging.cc +++ b/src/logging.cc @@ -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 { |