]> git.saurik.com Git - wxWidgets.git/commitdiff
iconv() really never set the trailing 0.
authorRobert Roebling <robert@roebling.de>
Sat, 17 Aug 2002 19:36:07 +0000 (19:36 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 17 Aug 2002 19:36:07 +0000 (19:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/strconv.cpp

index b4eaa65148a6ef9e862cbda69529d5a525aadf82..a7db44b730d07506228f03468ec257e8164289dc 100644 (file)
@@ -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
     {