mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-15 14:53:32 +08:00
Subnormal floats with mantissas of 7 or less (14 before the previous fix) have less digits to format than the conversion loop expects, causing it to never meet the condition to exit and looping forever. This cannot occur with normal floats because the implicit leading 1 always produces a sufficiently large value to format. This causes a hang with the 12 floats closest to zero (26 before the previous fix) if a suitably large precision is passed (which it is by default using e.g. `%f`). Fix by exiting the conversion loop if we get in the case where we can't add any more digits. Co-authored-by: JasonMDavey <65718912+JasonMDavey@users.noreply.github.com>