Added error check for if the input and output files are the same

This commit is contained in:
Jordan Cristiano 2015-06-25 00:00:30 -04:00
parent fea8bf485c
commit aecc11163f

View File

@ -52,6 +52,11 @@ int main(const int argc, const char* argv[])
std::string inputFile(argv[1]);
std::string outputFile(argv[2]);
if (inputFile == outputFile)
{
fprintf(stderr, "Error: Input and output file cannot be the same!\n");
return -1;
}
FileType inputType = GetFileType(inputFile);
FileType outputType = GetFileType(outputFile);