Skip to content

Commit

Permalink
Merge pull request #1003 from jphickey/fix-1002-utassert-newlines
Browse files Browse the repository at this point in the history
Fix #1002, remove extra newlines in utassert logs
  • Loading branch information
astrogeco authored May 12, 2021
2 parents b8ef55c + 51e4f85 commit 2607cd2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ut_assert/src/utbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage)
{
const char *Prefix;
char Buffer[16];
size_t MsgLen;
uint32 TermModeBits = OS_BSP_CONSOLEMODE_NORMAL;
uint32 MsgEnabled = BSP_UT_Global.CurrVerbosity >> MessageType;

Expand Down Expand Up @@ -182,8 +183,12 @@ void UT_BSP_DoText(uint8 MessageType, const char *OutputMessage)
}

OS_BSP_ConsoleOutput_Impl(" ", 1);
OS_BSP_ConsoleOutput_Impl(OutputMessage, strlen(OutputMessage));
OS_BSP_ConsoleOutput_Impl("\n", 1);
MsgLen = strlen(OutputMessage);
OS_BSP_ConsoleOutput_Impl(OutputMessage, MsgLen);
if (MsgLen == 0 || OutputMessage[MsgLen - 1] != '\n')
{
OS_BSP_ConsoleOutput_Impl("\n", 1);
}

OS_BSP_Unlock_Impl();
}
Expand Down

0 comments on commit 2607cd2

Please sign in to comment.