Win32: change buffer size for gethotsname in Discover()

- 256 byte is the maximum, as per
  http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527%28v=vs.85%29.aspx
This commit is contained in:
Philip Kaufmann 2014-11-13 15:23:15 +01:00
parent 8fa0494e92
commit cd4d3f1915

View file

@ -1559,7 +1559,7 @@ void static Discover(boost::thread_group& threadGroup)
#ifdef WIN32 #ifdef WIN32
// Get local host IP // Get local host IP
char pszHostName[1000] = ""; char pszHostName[256] = "";
if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)
{ {
vector<CNetAddr> vaddr; vector<CNetAddr> vaddr;