I think *r = '\0' is enough here. Per precedence table the precedence of postfix increment operator is higher. The above statement increments 'r' pointer address but returns the original un-incremented pointer address, which is then dereferenced. Correct me if I am wrong here.
If my understanding is correct then '++' is not needed in the above highlighted statement which is leading to overhead.
Find an attached patch which does the same. This can be backported till v96.