Add check for file length determining if it's a SHA-1 or not

This commit is contained in:
Matt Nadareski
2016-05-22 17:41:52 -07:00
parent 6e07324b42
commit b1554445c5

View File

@@ -374,11 +374,18 @@ namespace SabreTools
/// <param name="item">Filename of the item to be checked</param>
private void ProcessFile(string item)
{
// Special case for if we are in Romba mode (all names are SHA-1 hashes)
// Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes)
if (_datdata.Romba)
{
string datum = Path.GetFileNameWithoutExtension(item);
// Check if the name is the right length
if (datum.Length != 40)
{
_logger.Warning("Non SHA-1 filename found, skipping: '" + datum + "'");
return;
}
RomData rom = new RomData
{
Type = "rom",