summaryrefslogtreecommitdiffstats
path: root/generic/tclIOSock.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r--generic/tclIOSock.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index c6cef55..47fde36 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -75,7 +75,11 @@ TclSockGetPort(
* Don't bother translating 'proto' to native.
*/
- native = Tcl_UtfToExternalDString(NULL, string, -1, &ds);
+ if (Tcl_UtfToExternalDStringEx(interp, NULL, string, -1, 0, &ds, NULL) != TCL_OK) {
+ Tcl_DStringFree(&ds);
+ return TCL_ERROR;
+ }
+ native = Tcl_DStringValue(&ds);
sp = getservbyname(native, proto); /* INTL: Native. */
Tcl_DStringFree(&ds);
if (sp != NULL) {
@@ -184,7 +188,11 @@ TclCreateSocketAddress(
int result;
if (host != NULL) {
- native = Tcl_UtfToExternalDString(NULL, host, -1, &ds);
+ if (Tcl_UtfToExternalDStringEx(interp, NULL, host, -1, 0, &ds, NULL) != TCL_OK) {
+ Tcl_DStringFree(&ds);
+ return 0;
+ }
+ native = Tcl_DStringValue(&ds);
}
/*