mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-29 19:24:27 +01:00
Fix strict-overflow compiler warning
By replacing "x < y + 1" with "x <= y" the compiler doesn't have to do it and the warning "assuming signed overflow does not occur when reducing constant in comparison [-Werror=strict-overflow]" is avoided.
This commit is contained in:
@@ -445,7 +445,7 @@ void UnityPrintFloat(const UNITY_DOUBLE input_number)
|
|||||||
|
|
||||||
/* build up buffer in reverse order */
|
/* build up buffer in reverse order */
|
||||||
digits = 0;
|
digits = 0;
|
||||||
while ((n != 0) || (digits < (decimals + 1)))
|
while ((n != 0) || (digits <= decimals))
|
||||||
{
|
{
|
||||||
buf[digits++] = (char)('0' + n % 10);
|
buf[digits++] = (char)('0' + n % 10);
|
||||||
n /= 10;
|
n /= 10;
|
||||||
|
|||||||
Reference in New Issue
Block a user