You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2008/02/14 00:27:08 UTC
svn commit: r627612 - /stdcxx/trunk/include/loc/_money_put.cc
Author: sebor
Date: Wed Feb 13 15:27:02 2008
New Revision: 627612
URL: http://svn.apache.org/viewvc?rev=627612&view=rev
Log:
2008-02-13 Martin Sebor <se...@roguewave.com>
STDCXX-729
* _money_put.cc (_C_put): Worked around an HP aCC 6.15/cadvise
bug causing warning #20200-D: potential null pointer dereference.
Modified:
stdcxx/trunk/include/loc/_money_put.cc
Modified: stdcxx/trunk/include/loc/_money_put.cc
URL: http://svn.apache.org/viewvc/stdcxx/trunk/include/loc/_money_put.cc?rev=627612&r1=627611&r2=627612&view=diff
==============================================================================
--- stdcxx/trunk/include/loc/_money_put.cc (original)
+++ stdcxx/trunk/include/loc/_money_put.cc Wed Feb 13 15:27:02 2008
@@ -22,7 +22,7 @@
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
- * Copyright 1994-2006 Rogue Wave Software.
+ * Copyright 1994-2008 Rogue Wave Software, Inc.
*
**************************************************************************/
@@ -71,21 +71,21 @@
const _Punct1* __pun1;
if (__intl) {
- __pun0 = 0;
__pun1 = &_RWSTD_USE_FACET (_Punct1, __flags.getloc ());
}
else {
__pun0 = &_RWSTD_USE_FACET (_Punct0, __flags.getloc ());
- __pun1 = 0;
}
const ctype<_CharT> &__ctp =
_RWSTD_USE_FACET (ctype<_CharT>,__flags.getloc ());
+ const char __signchar = __ctp.narrow (*__s, '\0');
+
money_base::pattern __fmat; // negative or positive format
string_type __sign; // negative or positive sign
- if ('-' == __ctp.narrow (*__s, '\0')) {
+ if ('-' == __signchar) {
if (__intl) {
__fmat = __pun1->neg_format ();
__sign = __pun1->negative_sign ();
@@ -106,7 +106,7 @@
__fmat = __pun0->pos_format ();
__sign = __pun0->positive_sign ();
}
- if ('+' == __ctp.narrow (*__s, '\0')) {
+ if ('+' == __signchar) {
++__s;
--__n;
}