summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-07-04 13:41:14 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-07-04 13:41:14 (GMT)
commit8e7b0459fe6011676a85f83cddada3b34aa4e8e9 (patch)
treed4d7483235952e765ef7d6320705567fc1a9f650 /win
parentd3104ac52bdca1849c62445954323c841fcd5009 (diff)
downloadtcl-8e7b0459fe6011676a85f83cddada3b34aa4e8e9.zip
tcl-8e7b0459fe6011676a85f83cddada3b34aa4e8e9.tar.gz
tcl-8e7b0459fe6011676a85f83cddada3b34aa4e8e9.tar.bz2
only use public API in loaded packages; oops\!
Diffstat (limited to 'win')
-rw-r--r--win/tclWinReg.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 10437e6..565188c 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -1316,16 +1316,15 @@ SetValue(
Tcl_DStringInit(&data);
for (i = 0; i < objc; i++) {
- TclDStringAppendObj(&data, objv[i]);
+ const char *bytes = Tcl_GetStringFromObj(objv[i], &length);
+
+ Tcl_DStringAppend(&data, bytes, length);
/*
- * Add a null character to separate this value from the next. We
- * accomplish this by growing the string by one byte. Since the
- * DString always tacks on an extra null byte, the new byte will
- * already be set to null.
+ * Add a null character to separate this value from the next.
*/
- Tcl_DStringSetLength(&data, Tcl_DStringLength(&data)+1);
+ Tcl_DStringAppend(&data, "", 1); /* NUL-terminated string */
}
Tcl_WinUtfToTChar(Tcl_DStringValue(&data), Tcl_DStringLength(&data)+1,