Multiple *ptr++ constructs in one expression have undefined behaviour, moved them out of the expression.