diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-11-13 14:59:38 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-11-13 14:59:38 (GMT) |
commit | 5717e880e963ee03f2a8fe2f1732b295331b0b22 (patch) | |
tree | b1507924028b135541a04022b7ee6715762b69be /unix | |
parent | 7cfeefd4a1423e79d7303a8603ab8f6a32546fc9 (diff) | |
download | tcl-5717e880e963ee03f2a8fe2f1732b295331b0b22.zip tcl-5717e880e963ee03f2a8fe2f1732b295331b0b22.tar.gz tcl-5717e880e963ee03f2a8fe2f1732b295331b0b22.tar.bz2 |
Forgot to transform to native encoding for getaddrinfo()
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixChan.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 6949f8b..3b8098c 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.85 2007/11/13 14:52:49 das Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.86 2007/11/13 14:59:38 dkf Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -2646,6 +2646,7 @@ CreateSocketAddress( { #ifdef HAVE_GETADDRINFO struct addrinfo hints, *resPtr = NULL; + Tcl_DString ds; int result; if (host == NULL) { @@ -2668,7 +2669,9 @@ CreateSocketAddress( * that right, it shouldn't use this part of the code. */ - result = getaddrinfo(host, NULL, &hints, &resPtr); + native = Tcl_UtfToExternalDString(NULL, host, -1, &ds); + result = getaddrinfo(Tcl_DStringValue(&ds), NULL, &hints, &resPtr); + Tcl_DStringFree(&ds); if (result == 0) { memcpy(sockaddrPtr, resPtr->ai_addr, sizeof(struct sockaddr_in)); freeaddrinfo(resPtr); |