Skip to content

Commit

Permalink
Merge pull request #973 from jphickey/fix-964-utprintx-loop
Browse files Browse the repository at this point in the history
Fix #964, UtPrintx function
  • Loading branch information
astrogeco authored May 3, 2021
2 parents a061666 + d059147 commit 8a9b9ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ut_assert/src/uttools.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,22 @@ void UtPrintx(const void *Memory, uint32 Length)
uint32 i;
uint32 j;
const uint8 *Byte_ptr = Memory;
char OutputLine[50];
char OutputLine[80];
char * OutPtr;

i = 0;
while (1)
while (i < Length)
{
snprintf(OutputLine, sizeof(OutputLine), "%16lx: ", (unsigned long)&Byte_ptr[i]);
OutPtr = OutputLine;
OutPtr += strlen(OutputLine);
for (j = 0; j < 16 && i < Length; j++, i++)
{
sprintf(OutPtr, "%02X ", Byte_ptr[i]);
OutPtr += 3;
}
UtPrintf("%s\n", OutputLine);

UT_BSP_DoText(UTASSERT_CASETYPE_INFO, OutputLine);
}
}

Expand Down

0 comments on commit 8a9b9ee

Please sign in to comment.