mirror of
https://github.com/php/php-src.git
synced 2026-03-28 10:12:18 +01:00
negative memory size in situations where the sprintf implementation of the host system generated less decimal places than were requested. Resolved this issue by making number_format examine the string returned by spprintf and have it pad to the correct number of decimal places. Added a test-case based on the bug report; the length of decimal places required to trigger this bug is sprintf implementation dependent; as the implementation is now using spprintf (provided by PHP), that number is 78 digits (NDIG - 2). # I played with the idea of enhancing sprintf to do the equivalent, but # it was too much effort considering that the precision of floats/doubles # is not good enough to warrant it. # This fix could do with some QA from someone else to make sure there are # no memory bounds problems and then MFH it to PHP_4_3