summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r--win/tclWinSock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 8b42b9b..8f61b08 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -363,12 +363,12 @@ InitializeHostName(
unsigned int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
- WCHAR wbuf[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD length = MAX_COMPUTERNAME_LENGTH + 1;
+ WCHAR wbuf[256];
+ DWORD length = sizeof(wbuf)/sizeof(WCHAR);
Tcl_DString ds;
Tcl_DStringInit(&ds);
- if (GetComputerNameW(wbuf, &length) != 0) {
+ if (GetComputerNameExW(ComputerNameDnsFullyQualified, wbuf, &length) != 0) {
/*
* Convert string from native to UTF then change to lowercase.
*/