summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-11-29 18:00:19 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-11-29 18:00:19 (GMT)
commit2ba9c1b2b70a505b5a12b43810f1ab651c650250 (patch)
treea6f1661b8b3991d16bc721b153b1d0ee9259fdce
parent8f2fee65ee84fd8a8baa994417d502dbaf311cbe (diff)
downloadtcl-2ba9c1b2b70a505b5a12b43810f1ab651c650250.zip
tcl-2ba9c1b2b70a505b5a12b43810f1ab651c650250.tar.gz
tcl-2ba9c1b2b70a505b5a12b43810f1ab651c650250.tar.bz2
* 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.
-rw-r--r--ChangeLog7
-rw-r--r--win/tclWinSock.c6
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 <dgp@users.sourceforge.net>
+
+ * 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 <dgp@users.sourceforge.net>
* 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);
}