Added an overflow check for the file suffix.