client9 / stringencoders

Fast c-string transformations
MIT License
135 stars 51 forks source link

silent overflow modp_litoa10 is given LONG_MIN #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Thanks for writing this library, I've been using the integer to string
functions successfully w/ great speed gain. But I had to fix a small issue
with both modp_litoa10 and modp_itoa10 functions. When modp_litoa10 is
given the number LONG_MIN, there's an overflow in the "value=-value"
statement, this can be easily solved by making an unsigned long receive the
-value.
Please see the proposed fix in the attachment. The same principle applies
to modp_itoa10.

Original issue reported on code.google.com by simhas...@gmail.com on 16 Dec 2009 at 2:31

Attachments:

GoogleCodeExporter commented 9 years ago
Fantastic! Tonight I am busy, but I will get these in tomorrow.

Original comment by nickgsup...@gmail.com on 16 Dec 2009 at 5:36

GoogleCodeExporter commented 9 years ago
thanks for your patience
You suggestion is now in SVN, and now includes a unit test for both 32 and 
64-bit 
versions.

Original comment by nickgsup...@gmail.com on 12 Feb 2010 at 9:03