From a150f64e9c5cc96cc5ff0644f0ab3255c30991ba Mon Sep 17 00:00:00 2001 From: crs Date: Wed, 24 Jul 2002 19:23:46 +0000 Subject: [PATCH] fixed an off-by-one error in UTF8ToText(). --- base/CUnicode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/CUnicode.cpp b/base/CUnicode.cpp index cc22f3c1..1c17afdd 100644 --- a/base/CUnicode.cpp +++ b/base/CUnicode.cpp @@ -227,7 +227,7 @@ CUnicode::UTF8ToText(const CString& src, bool* errors) // handle nul terminator mblen = wcrtomb(mbc, L'\0', &state); if (mblen != -1) { - len += mblen - 1; + len += mblen; } assert(mbsinit(&state) != 0);