From 7291c37aa8f406b9487963a1b7fd6ee45b2e0b34 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 17 Aug 2002 19:36:07 +0000 Subject: [PATCH] iconv() really never set the trailing 0. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/strconv.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index b4eaa65148..a7db44b730 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -723,6 +723,10 @@ size_t IC_CharSet::WC2MB(char *buf, const wchar_t *psz, size_t n) cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf ); res = n-outbuf; + + // iconv() doesn't set the trailing zero, but moves buf to + // that position + buf[0] = 0; } else { -- 2.45.2