Fixing buffer overflow with long file names.