summaryrefslogtreecommitdiffstats
path: root/win/tclWinReg.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinReg.c')
-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);