[xml] Test comparison fails on value (-2147483648)



VERSIONS: libxml2-2.4.3
          libxslt-1.0.3

PROBLEM:
The tag <xsl:when test="OutputWatts &lt; 0"> fails to evaluate correctly 
when OutputWatts is equal to -2147483648.  


PROPOSED RESOLUTION:
xpath:xmlXPathStringEvalNumber(6567)
------------------------------------------------------------
<       ret = (double) tmp;
----------
      ret = (double) tmp;
      // Variable tmp is declared as signed integer which may evaluate to
a negative
      // number.  We only need to calculate the absolute value of the
whole number since
      // any negative character in the input string has been flagged
separately.
      if (tmp < 0)
              ret = -ret;
------------------------------------------------------------



_______________________________
Chris Poblete
Dell © Enterprise Servers Group






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]