summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-21 09:25:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-21 09:25:03 (GMT)
commit5eb39e3973c7016b834d0881ca4c69515a1e89e0 (patch)
treef5c163ee2e6d922adac0b0936ced7232380d0ed7 /win/tclWinSock.c
parent1fb8e115c4cd0dc9a351e7a6e183f8956996117d (diff)
downloadtcl-5eb39e3973c7016b834d0881ca4c69515a1e89e0.zip
tcl-5eb39e3973c7016b834d0881ca4c69515a1e89e0.tar.gz
tcl-5eb39e3973c7016b834d0881ca4c69515a1e89e0.tar.bz2
Fix [da235271f1]: [info hostname] on Windows is limited to max NetBIOS name length
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 e52e509..d4df032 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -343,11 +343,11 @@ InitializeHostName(
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;
- if (GetComputerNameW(wbuf, &length) != 0) {
+ if (GetComputerNameExW(ComputerNameDnsFullyQualified, wbuf, &length) != 0) {
/*
* Convert string from native to UTF then change to lowercase.
*/