Fix CFE_TIME_print format fix: Cast and format -
now int to avoid possible string buffer overflow
@@ -103,10 +103,9 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint)
{
snprintf(PrintBuffer,
CFE_TIME_PRINTED_STRING_SIZE,
- "UT %lu.%lu -",
- (unsigned long)TimeToPrint.Seconds,
- (unsigned long)TimeToPrint.Subseconds);
-
+ "UT %u.%u -",
+ (unsigned int)TimeToPrint.Seconds,
+ (unsigned int)TimeToPrint.Subseconds);
UT_Stub_RegisterContext(UT_KEY(CFE_TIME_Print), PrintBuffer);
UT_Stub_RegisterContext(UT_KEY(CFE_TIME_Print), &TimeToPrint);
