Do not copy more bytes than the filename string contains.