tool_cb_wrt: fix debug assertion

- Fix off-by-one out-of-bounds array index in Windows debug assertion.

Bug: https://github.com/curl/curl/commit/af3f4e41#r127212213
Reported-by: Gisle Vanem
This commit is contained in:
Jay Satiro 2023-09-13 13:57:39 -04:00
parent 291d225a50
commit 73980f9ace

View File

@ -287,7 +287,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
if(MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)outs->utf8seq, -1,
prefix, sizeof(prefix)/sizeof(prefix[0]))) {
DEBUGASSERT(prefix[3] == L'\0');
DEBUGASSERT(prefix[2] == L'\0');
if(!WriteConsoleW(
(HANDLE) fhnd,
prefix,