Need to remember to terminate file names to account for trailing space

When we copy the input file string into the output before adding
the file extension we need to put in the \0.