mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-08-23 19:49:56 +00:00
Fix UnityPrintFloat() buffer overflow
UnityPrintFloat() overflowed with some inputs (eg. FLT_MAX)
This commit is contained in:
+1
-1
@@ -283,7 +283,7 @@ void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
|
|||||||
void UnityPrintFloat(_UF number)
|
void UnityPrintFloat(_UF number)
|
||||||
{
|
{
|
||||||
char TempBuffer[32];
|
char TempBuffer[32];
|
||||||
sprintf(TempBuffer, "%.6f", number);
|
snprintf(TempBuffer, sizeof(TempBuffer), "%.6f", number);
|
||||||
UnityPrint(TempBuffer);
|
UnityPrint(TempBuffer);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user