Skip to content

Commit

Permalink
Fix #2582, Cast to unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
tvisha.s.andharia committed Jul 22, 2024
1 parent d0e9564 commit 14d6426
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/msg/fsw/src/cfe_msg_sechdr_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ CFE_Status_t CFE_MSG_GetMsgTime(const CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTim
}

/* Get big endian time fields with default 32/16 layout */
Time->Subseconds = (tlm->Sec.Time[4] << 24) + (tlm->Sec.Time[5] << 16);
Time->Seconds = (tlm->Sec.Time[0] << 24) + (tlm->Sec.Time[1] << 16) + (tlm->Sec.Time[2] << 8) + tlm->Sec.Time[3];
Time->Subseconds = ((unsigned int)tlm->Sec.Time[4] << 24) + ((unsigned int)tlm->Sec.Time[5] << 16);
Time->Seconds = ((unsigned int)tlm->Sec.Time[0] << 24) + ((unsigned int)tlm->Sec.Time[1] << 16) + ((unsigned int)tlm->Sec.Time[2] << 8) + (unsigned int)tlm->Sec.Time[3];

return CFE_SUCCESS;
}

0 comments on commit 14d6426

Please sign in to comment.