From 73980f9ace6c7577e7fcab8008bbde8a0a231692 Mon Sep 17 00:00:00 2001
From: Jay Satiro <raysatiro@yahoo.com>
Date: Wed, 13 Sep 2023 13:57:39 -0400
Subject: [PATCH] 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
---
 src/tool_cb_wrt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c
index 2f8c6ac71e..b7838664e9 100644
--- a/src/tool_cb_wrt.c
+++ b/src/tool_cb_wrt.c
@@ -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,