Skip to content

Commit 84bb9d7

Browse files
authored
Merge pull request #1764 from jphickey/fix-1763-covtest-printf-log
Fix #1763, last char truncated in coverage log output
2 parents 4c91565 + e07f222 commit 84bb9d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/core_private/ut-stubs/src/ut_support.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ bool CFE_UtAssert_MessageCheck_Impl(bool Status, const char *File, uint32 Line,
654654

655655
/* Locate the actual end of the string, but limited to length of local buffer */
656656
/* Reserve two extra chars for quotes */
657-
EndPtr = memchr(FormatString, 0, sizeof(ScrubbedFormat) - 2);
657+
EndPtr = memchr(FormatString, 0, sizeof(ScrubbedFormat) - 3);
658658
if (EndPtr != NULL)
659659
{
660660
FormatLen = EndPtr - FormatString;
@@ -674,8 +674,8 @@ bool CFE_UtAssert_MessageCheck_Impl(bool Status, const char *File, uint32 Line,
674674
/* Need to make a copy, as the input string is "const" */
675675
ScrubbedFormat[0] = '\'';
676676
memcpy(&ScrubbedFormat[1], FormatString, FormatLen);
677-
ScrubbedFormat[FormatLen] = '\'';
678-
ScrubbedFormat[FormatLen + 1] = 0;
677+
ScrubbedFormat[FormatLen + 1] = '\'';
678+
ScrubbedFormat[FormatLen + 2] = 0;
679679

680680
return UtAssert_GenericSignedCompare(Status, UtAssert_Compare_GT, 0, UtAssert_Radix_DECIMAL, File, Line, Desc,
681681
ScrubbedFormat, "");

0 commit comments

Comments
 (0)