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 343a22f..a6ce2ce 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -794,7 +794,7 @@ GetValue(
* HKEY_PERFORMANCE_DATA
*/
- length *= 2;
+ length = Tcl_DStringLength(&data) * (regWinProcs->useWide ? 1 : 2);
Tcl_DStringSetLength(&data, (int) length * (regWinProcs->useWide ? 2 : 1));
result = (*regWinProcs->regQueryValueExProc)(key, (char *) nativeValue,
NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length);