aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2009-02-15 16:47:57 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2009-02-15 16:47:57 +0000
commitbbcac3becb8dcc1cf5a8d65926ce15b296f4367c (patch)
treeeb15a978460c1aaecb4876c6b96497177e6ac71a /libstdc++-v3/src
parent68c9ab451b8163597dee5ed2f7ee23859b9b453a (diff)
downloadgcc-bbcac3becb8dcc1cf5a8d65926ce15b296f4367c.zip
gcc-bbcac3becb8dcc1cf5a8d65926ce15b296f4367c.tar.gz
gcc-bbcac3becb8dcc1cf5a8d65926ce15b296f4367c.tar.bz2
re PR libstdc++/39168 (Incorrect interpretation of CHAR_MAX inside grouping string in monetary and numeric facets.)
2009-02-15 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/39168 * src/locale_facets.cc (__verify_grouping(const char*, size_t, const string&)): Also check that the value != CHAR_MAX. * include/bits/locale_facets.tcc (__numpunct_cache<>:: _M_cache(const locale&), __add_grouping(_CharT*, _CharT, const char*, size_t, const _CharT*, const _CharT*)): Likewise. * include/bits/locale_facets_nonio.tcc (__moneypunct_cache<>:: _M_cache(const locale&)): Likewise. * testsuite/22_locale/money_put/put/wchar_t/39168.cc: New. * testsuite/22_locale/money_put/put/char/39168.cc: Likewise. * testsuite/22_locale/money_get/get/wchar_t/39168.cc: Likewise. * testsuite/22_locale/money_get/get/char/39168.cc: Likewise. * testsuite/22_locale/num_get/get/wchar_t/39168.cc: Likewise. * testsuite/22_locale/num_get/get/char/39168.cc: Likewise. From-SVN: r144190
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/locale_facets.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libstdc++-v3/src/locale_facets.cc b/libstdc++-v3/src/locale_facets.cc
index 89c7e49..d62fb04 100644
--- a/libstdc++-v3/src/locale_facets.cc
+++ b/libstdc++-v3/src/locale_facets.cc
@@ -1,5 +1,5 @@
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007
+// 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -110,7 +110,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// ... but the first parsed grouping can be <= numpunct
// grouping (only do the check if the numpunct char is > 0
// because <= 0 means any size is ok).
- if (static_cast<signed char>(__grouping[__min]) > 0)
+ if (static_cast<signed char>(__grouping[__min]) > 0
+ && __grouping[__min] != __gnu_cxx::__numeric_traits<char>::__max)
__test &= __grouping_tmp[0] <= __grouping[__min];
return __test;
}