This commit is contained in:
whaffman 2025-04-03 14:44:37 +02:00
parent 0700c0e42b
commit 1cde096169

View File

@ -6,7 +6,7 @@
/* By: whaffman <whaffman@student.codam.nl> +#+ */ /* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/03/23 13:59:46 by whaffman #+# #+# */ /* Created: 2025/03/23 13:59:46 by whaffman #+# #+# */
/* Updated: 2025/04/02 11:20:09 by whaffman ######## odam.nl */ /* Updated: 2025/04/03 14:44:17 by whaffman ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -36,6 +36,14 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
if (argv[2][0] == '\0')
{
std::cout << "Old String shouldn't be empty" << std::endl;
inFile.close();
outFile.close();
return 1;
}
outFileName = argv[1]; outFileName = argv[1];
outFileName += ".replace"; outFileName += ".replace";
outFile.open(outFileName, std::ios::out); outFile.open(outFileName, std::ios::out);
@ -45,6 +53,7 @@ int main(int argc, char *argv[])
inFile.close(); inFile.close();
return 1; return 1;
} }
Replacer replacer(argv[2], argv[3]); Replacer replacer(argv[2], argv[3]);
while (std::getline(inFile, line)) while (std::getline(inFile, line))