summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r--win/tclWinSock.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index d46bfc0..1d61eb6 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinSock.c,v 1.57 2007/02/20 23:24:07 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.58 2007/11/27 20:38:40 dgp Exp $
*/
#include "tclWinInt.h"
@@ -2576,13 +2576,18 @@ InitializeHostName(
* Maintainers are welcome to supply it.
*/
- Tcl_DStringSetLength(&ds, 255);
- if (winSock.gethostname(Tcl_DStringValue(&ds),
- Tcl_DStringLength(&ds)) == 0) {
+ Tcl_DString inDs;
+
+ Tcl_DStringInit(&inDs);
+ Tcl_DStringSetLength(&inDs, 255);
+ if (winSock.gethostname(Tcl_DStringValue(&inDs),
+ Tcl_DStringLength(&inDs)) == 0) {
Tcl_DStringSetLength(&ds, 0);
} else {
- Tcl_DStringSetLength(&ds, strlen(Tcl_DStringValue(&ds)));
+ Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&inDs),
+ Tcl_DStringLength(&inDs), &ds);
}
+ Tcl_DStringFree(&inDs);
}
}