diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinClipboard.c | 3 | ||||
-rw-r--r-- | win/tkWinInit.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 93c5d42..a00909c 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -155,7 +155,8 @@ TkSelGetSelection( if (count) { Tcl_DStringAppend(&ds, "\n", 1); } - Tcl_WinTCharToUtf(fname, -1, &dsTmp); + len = Tcl_UniCharLen((Tcl_UniChar *) fname); + Tcl_WinTCharToUtf(fname, len * sizeof(WCHAR), &dsTmp); Tcl_DStringAppend(&ds, Tcl_DStringValue(&dsTmp), Tcl_DStringLength(&dsTmp)); Tcl_DStringFree(&dsTmp); diff --git a/win/tkWinInit.c b/win/tkWinInit.c index 4c18399..780888a 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -199,7 +199,7 @@ TkWin32ErrorObj( } #ifdef _UNICODE - Tcl_WinTCharToUtf(lpBuffer, (int)wcslen(lpBuffer) * sizeof (WCHAR), &ds); + Tcl_WinTCharToUtf(lpBuffer, wcslen(lpBuffer) * sizeof (WCHAR), &ds); errPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_DStringFree(&ds); #else |