summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 53bc913..852e5f7 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -476,8 +476,8 @@ TclpGetUserName(
return NULL;
}
cchUserNameLen--;
- cchUserNameLen *= sizeof(WCHAR);
- Tcl_WinTCharToUtf(szUserName, cchUserNameLen, bufferPtr);
+ Tcl_DStringInit(bufferPtr);
+ Tcl_WCharToUtfDString(szUserName, cchUserNameLen, bufferPtr);
}
return Tcl_DStringValue(bufferPtr);
}