Save some cycle. There is no need to copy, strchr, strcmp and modify a string which is only used for TRACE2 logging. Note that the code that looks similar a few lines below can not be optimized the same way because it is also returned in 'pmessage'.