From 2ba9c1b2b70a505b5a12b43810f1ab651c650250 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 29 Nov 2007 18:00:19 +0000 Subject: * generic/tclWinSock.c (InitializeHostName): Correct error in buffer length tracking. After gethostname() writes into a buffer, convert only the written string to internal encoding, not the whole buffer. --- ChangeLog | 7 +++++++ win/tclWinSock.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 921b493..e54d34a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-29 Don Porter + + * generic/tclWinSock.c (InitializeHostName): Correct error in + buffer length tracking. After gethostname() writes into a buffer, + convert only the written string to internal encoding, not the + whole buffer. + 2007-11-28 Don Porter * generic/tclConfig.c: Corrected failure of the [::foo::pkgconfig] diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 1d61eb6..99300d6 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.58 2007/11/27 20:38:40 dgp Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.59 2007/11/29 18:00:20 dgp Exp $ */ #include "tclWinInt.h" @@ -2584,8 +2584,8 @@ InitializeHostName( Tcl_DStringLength(&inDs)) == 0) { Tcl_DStringSetLength(&ds, 0); } else { - Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&inDs), - Tcl_DStringLength(&inDs), &ds); + Tcl_ExternalToUtfDString(NULL, + Tcl_DStringValue(&inDs), -1, &ds); } Tcl_DStringFree(&inDs); } -- cgit v0.12