summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-20 12:39:45 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-20 12:39:45 (GMT)
commit30fc8288f30a0b85762005fe52e18d254044d43b (patch)
treecc6a6199b2314475853510aba090a1016d99641e
parent59237b6ac5e62f44c6451465d76f19bb3c97469b (diff)
downloadtk-30fc8288f30a0b85762005fe52e18d254044d43b.zip
tk-30fc8288f30a0b85762005fe52e18d254044d43b.tar.gz
tk-30fc8288f30a0b85762005fe52e18d254044d43b.tar.bz2
Don't use wcslen() in combination with Tcl_WinTCharToUtf(): Using -1 has the same effect already (it even was wrong in tkWinTest.c's previous commit, forgot to multiply with sizeof(WCHAR)).
-rw-r--r--win/tkWinInit.c2
-rw-r--r--win/tkWinTest.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/win/tkWinInit.c b/win/tkWinInit.c
index 780888a..e3c75de 100644
--- a/win/tkWinInit.c
+++ b/win/tkWinInit.c
@@ -199,7 +199,7 @@ TkWin32ErrorObj(
}
#ifdef _UNICODE
- Tcl_WinTCharToUtf(lpBuffer, wcslen(lpBuffer) * sizeof (WCHAR), &ds);
+ Tcl_WinTCharToUtf(lpBuffer, -1, &ds);
errPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
Tcl_DStringFree(&ds);
#else
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index e51b6a2..04ecb97 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -177,7 +177,7 @@ AppendSystemError(
} else {
char *msgPtr;
- Tcl_WinTCharToUtf(wMsgPtr, wcslen(wMsgPtr), &ds);
+ Tcl_WinTCharToUtf(wMsgPtr, -1, &ds);
LocalFree(wMsgPtr);
msgPtr = Tcl_DStringValue(&ds);