Properly copy text into user supplied buffer.