diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-03 19:48:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-03 19:48:14 (GMT) |
commit | 087b06187ceff43e2fb4299a0da24c6f694e3672 (patch) | |
tree | 48ec1343fc6ca9728a2517a528e68601413c1c88 /generic/tclIOSock.c | |
parent | 529b7e026c99752ee4d072259f7c701fbfe470a8 (diff) | |
download | tcl-087b06187ceff43e2fb4299a0da24c6f694e3672.zip tcl-087b06187ceff43e2fb4299a0da24c6f694e3672.tar.gz tcl-087b06187ceff43e2fb4299a0da24c6f694e3672.tar.bz2 |
TIP #548: Deprecate Tcl_WinUtfToTChar() and Tcl_WinTCharToUtf() and provide more flexible replacement functions
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r-- | generic/tclIOSock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index 12e2900..dd56c44 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -30,11 +30,12 @@ gai_strerror( ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); if (tsdPtr->initialized) { - Tcl_DStringFree(&tsdPtr->errorMsg); + Tcl_DStringSetLength(&tsdPtr->errorMsg, 0); } else { + Tcl_DStringInit(&tsdPtr->errorMsg); tsdPtr->initialized = 1; } - Tcl_WinTCharToUtf(gai_strerrorW(code), -1, &tsdPtr->errorMsg); + Tcl_Utf16ToUtfDString(gai_strerrorW(code), -1, &tsdPtr->errorMsg); return Tcl_DStringValue(&tsdPtr->errorMsg); } #endif |