stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r650678 - /stdcxx/branches/4.2.x/util/charmap.cpp
Date Tue, 22 Apr 2008 22:25:17 GMT
Author: sebor
Date: Tue Apr 22 15:24:48 2008
New Revision: 650678

URL: http://svn.apache.org/viewvc?rev=650678&view=rev
Log:
2008-04-22  Martin Sebor  <sebor@roguewave.com>

	STDCXX-753
	* util/charmap.cpp (Charmap::convert_to_ucs): Unconditionally
	allocated (8 + 1) bytes for the longest UTF-8 character rather
	than assuming that MB_LEN_MAX is large enough.

Modified:
    stdcxx/branches/4.2.x/util/charmap.cpp

Modified: stdcxx/branches/4.2.x/util/charmap.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/util/charmap.cpp?rev=650678&r1=650677&r2=650678&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/util/charmap.cpp (original)
+++ stdcxx/branches/4.2.x/util/charmap.cpp Tue Apr 22 15:24:48 2008
@@ -22,7 +22,7 @@
  * implied.   See  the License  for  the  specific language  governing
  * permissions and limitations under the License.
  *
- * Copyright 2001-2007 Rogue Wave Software, Inc.
+ * Copyright 2001-2008 Rogue Wave Software, Inc.
  * 
  **************************************************************************/
 
@@ -671,7 +671,8 @@
         return true;
     }
 
-    char utf8_enc [_RWSTD_MB_LEN_MAX + 1];
+    // allocate enough space for the longest possible UTF-8 character
+    char utf8_enc [8 + 1 /* NUL */];
 
     const char* const ch_end =
         convert_to_utf8  (encoding.c_str (), encoding.size (),



Mime
View raw message