The routine copies "fileNameLen" characters from the original filename
plus one additional character or a trailing blank. This additional char
is overwritten by a terminating null-byte afterwards anyway.
Remove the redundant check and simplify the loop.