summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}