Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage-eds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
uses: ./cfe/.github/actions/code-coverage
with:
module-list: config core_api core_private es evs fs resourceid sb sbr tbl time
allowed-missed-branches: 21
allowed-missed-lines: 13
allowed-missed-branches: 22
allowed-missed-lines: 14
allowed-missed-functions: 0
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ jobs:
uses: ./cfe/.github/actions/code-coverage
with:
module-list: config core_api core_private es evs fs msg resourceid sb sbr tbl time
allowed-missed-branches: 13
allowed-missed-lines: 7
allowed-missed-branches: 14
allowed-missed-lines: 8
allowed-missed-functions: 0
9 changes: 7 additions & 2 deletions modules/time/fsw/src/cfe_time_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,20 @@ CFE_Status_t CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint)
{
size_t FmtLen = 0;
uint32 Micros = (CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS) / 10;
struct tm tm;
struct tm tm = { 0 };

if (PrintBuffer == NULL)
{
return CFE_TIME_BAD_ARGUMENT;
}

time_t sec = TimeToPrint.Seconds + CFE_MISSION_TIME_EPOCH_SECONDS; // epoch is Jan 1, 1980
gmtime_r(&sec, &tm);

if (gmtime_r(&sec, &tm) == NULL)
{
return CFE_TIME_BAD_ARGUMENT;
}

FmtLen = strftime(PrintBuffer, CFE_TIME_PRINTED_STRING_SIZE - 6, "%Y-%j-%H:%M:%S", &tm);
PrintBuffer += FmtLen;
*(PrintBuffer++) = '.';
Expand Down
Loading