[PATCH rtems-tools v1 4/7] TraceReaderLogQEMU.cc: Fix formatting

Chris Johns chrisj at rtems.org
Thu Sep 23 00:23:58 UTC 2021


On 23/9/21 12:35 am, Ryan Long wrote:
> I changed the definition of discardBuff to
> 
> char discardBuff[100]{};

char discardBuff[100] = {};

?

> So that every element will be initialized to \0. This function is only used in TraceReaderLogQEMU.cc, and the values that are passed in are
> 
> #define QEMU_LOG_IN_KEY "IN: "
> #define QEMU_LOG_SECTION_END "----------------"
> 
> Neither are close to going over the size of discardBuff, but I can add a check and return false if it does happen to go over that length.

Checking how the call is being used is cheating ... :)

Lets make the code robust and if someone makes a change and makes a mistake it
is caught.

Chris


More information about the devel mailing list