summaryrefslogtreecommitdiff
path: root/sal/rtl/math.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/rtl/math.cxx')
-rw-r--r--sal/rtl/math.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx
index 5d4ed6061f97..feb3a2b1852d 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -835,16 +835,21 @@ double stringToDouble(CharT const * pBegin, CharT const * pEnd,
}
bool bSign;
+ bool explicitSign = false;
if (p0 != pEnd && *p0 == CharT('-'))
{
bSign = true;
+ explicitSign = true;
++p0;
}
else
{
bSign = false;
if (p0 != pEnd && *p0 == CharT('+'))
+ {
+ explicitSign = true;
++p0;
+ }
}
CharT const * p = p0;
@@ -853,7 +858,7 @@ double stringToDouble(CharT const * pBegin, CharT const * pEnd,
// #i112652# XMLSchema-2
if ((pEnd - p) >= 3)
{
- if ((CharT('N') == p[0]) && (CharT('a') == p[1])
+ if (!explicitSign && (CharT('N') == p[0]) && (CharT('a') == p[1])
&& (CharT('N') == p[2]))
{
p += 3;