diff options
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index aba0f04..6a48c13 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1444,13 +1444,15 @@ TclpGetUserHome( } Tcl_DStringFree(&ds); } else { - wName = Tcl_WinUtfToTChar(domain + 1, -1, &ds); + Tcl_DStringInit(&ds); + wName = TclUtfToWCharDString(domain + 1, -1, &ds); rc = NetGetDCName(NULL, wName, (LPBYTE *) &wDomain); Tcl_DStringFree(&ds); nameLen = domain - name; } if (rc == 0) { - wName = Tcl_WinUtfToTChar(name, nameLen, &ds); + Tcl_DStringInit(&ds); + wName = TclUtfToWCharDString(name, nameLen, &ds); while (NetUserGetInfo(wDomain, wName, 1, (LPBYTE *) &uiPtr) != 0) { /* * user does not exists - if domain was not specified, @@ -1468,14 +1470,14 @@ TclpGetUserHome( wHomeDir = uiPtr->usri1_home_dir; if ((wHomeDir != NULL) && (wHomeDir[0] != L'\0')) { size = lstrlenW(wHomeDir); - Tcl_WinTCharToUtf((TCHAR *) wHomeDir, size * sizeof(WCHAR), bufferPtr); + TclWCharToUtfDString(wHomeDir, size, bufferPtr); } else { /* * User exists but has no home dir. Return * "{GetProfilesDirectory}/<user>". */ GetProfilesDirectoryW(buf, &size); - Tcl_WinTCharToUtf(buf, (size-1) * sizeof(WCHAR), bufferPtr); + TclWCharToUtfDString(buf, size-1, bufferPtr); Tcl_DStringAppend(bufferPtr, "/", 1); Tcl_DStringAppend(bufferPtr, name, nameLen); } @@ -2895,7 +2897,7 @@ TclpNativeToNormalized( { Tcl_DString ds; Tcl_Obj *objPtr; - int len; + size_t len; char *copy, *p; Tcl_WinTCharToUtf((const TCHAR *) clientData, -1, &ds); |