Skip to content

Commit 75b33e9

Browse files
committed
IAR: Fix spurious newline after time in JUnit output.
Remove the newline character after the date and time in the JUnit output on IAR platform.
1 parent 2b45d38 commit 75b33e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎src/Platforms/Iar/UtestPlatform.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ static long TimeInMillisImplementation()
115115
static const char* TimeStringImplementation()
116116
{
117117
time_t tm = time(NULL);
118-
return ctime(&tm);
118+
char* pTimeStr = ctime(&tm);
119+
char* newlineChar = strchr(pTimeStr, '\n'); // Find the terminating newline character.
120+
if(newlineChar != NULL) *newlineChar = '\0'; //If newline is found replace it with the string terminator.
121+
return (pTimeStr);
119122
}
120123

121124
long (*GetPlatformSpecificTimeInMillis)() = TimeInMillisImplementation;

0 commit comments

Comments
 (0)