summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-11 19:30:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-11 19:30:42 (GMT)
commit0ad251426f08aff23e62fff6365bafc1af4e182f (patch)
treee27700ed8c7b156d4def38a90ab9d4b47194999e /win
parentfcb1a092aeea82d23c7d8957f677c0af36fc7371 (diff)
parentc31e9810372c9b7fb8b61dd0840ed8f87ecf79f0 (diff)
downloadtcl-0ad251426f08aff23e62fff6365bafc1af4e182f.zip
tcl-0ad251426f08aff23e62fff6365bafc1af4e182f.tar.gz
tcl-0ad251426f08aff23e62fff6365bafc1af4e182f.tar.bz2
[Bug #3362446]: registry keys command fails with 8.5/8.6. Follow Microsofts example better in order to prevent problems when using HKEY_PERFORMANCE_DATA.
Diffstat (limited to 'win')
-rw-r--r--win/tclWinReg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 565188c..d2f233e 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -780,7 +780,7 @@ GetValue(
* HKEY_PERFORMANCE_DATA
*/
- length *= 2;
+ length = Tcl_DStringLength(&data) * (2 / sizeof(TCHAR));
Tcl_DStringSetLength(&data, (int) length * sizeof(TCHAR));
result = RegQueryValueEx(key, nativeValue,
NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length);