1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

Fix warning with ubsan and -Wconversion

This fixes a compiler warning about a lossy conversion from long
unsigned int to int when compiling unity with gcc 6.3.1 and
the options -std=c89 -Wconversion -fsanitize=undefined
This commit is contained in:
Max Bruckner
2017-03-01 17:07:05 +01:00
parent b5da224fd8
commit 7bce0b4f0c

View File

@@ -194,7 +194,7 @@ void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
while (nibbles > 0)
{
nibbles--;
nibble = (number >> (nibbles * 4)) & 0x0F;
nibble = (int)(number >> (nibbles * 4)) & 0x0F;
if (nibble <= 9)
{
UNITY_OUTPUT_CHAR((char)('0' + nibble));