do not write string to itself, instead use pointer magic

This fixes compilation with some optimization enabled.