Merge pull request #17171 from mppf/fix-ftoa-core-bug
fix I/O bug in _ftoa_core to solve issue 17170
PR #3870 added some code to
_ftoa_core that examines and updates the
output. But, it did not correctly handle the case that not all of the
output was present (in particular when there was not enough room left in
the current buffer) or when
snprintf returned an error. This PR updates
the existing conditional to check that the
snprintf was successful.
(Note that if
buf_sz that would actually indicate
not enough room in the output because
snprintf would store the trailing
\0 byte instead of the expected output as the last character).
Adds a test that reproduces the error so we can avoid it in the future.
- [x] full local testing
Reviewed by @ben-albrecht - thanks!