portapack-mayhem / mayhem-firmware

Custom firmware for the HackRF+PortaPack H1/H2/H4
https://hackrf.app
GNU General Public License v3.0
3.3k stars 540 forks source link

Fix bug in to_string_decimal #2114

Closed htotoo closed 5 months ago

htotoo commented 5 months ago

There is a bug in to_string_decimal, when we use too high precision (>9) the result will be invalid, since we will cast the double fraction value to uint32_t. That can hold 9 digits safely. So limiting precision to 9.