protected against distributing file with non-LGPL3 content

This commit is contained in:
FeralChild64 committed 2020-09-27 16:57:39 +02:00
1 parent 5704a8d4cd
commit ff98d2c5c2
4 files changed
+28 -15

No files matched your search

+12 -1
View File
@@ -70,7 +70,8 @@ const std::vector<uint8_t> STR_SNAPSHOT = { 0x28, 0x44, 0x45, 0x56, 0x45, 0x4C,
0x00 };
const std::vector<uint8_t> STR_DOSDATE = { 0x4F, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58 };
const std::string STR_DEV = "DEV.";
const std::string STR_DEV = "DEV.";
const std::string STR_BLOCK = "DO NOT DISTRIBUTE";
//
// Command and enviroment line settings
@@ -357,6 +358,16 @@ void ROMFile::readSrcFile()
if (!srcFile.good()) ERROR(std::string("unable to read ROM file '") + srcFileNamePath + "'");
srcFile.close();
// Check if it is OK to distribute the file
for (size_t idx = 0; idx < srcFileContent.size() - STR_BLOCK.size(); idx++)
{
if (memcmp(&srcFileContent[idx], STR_BLOCK.c_str(), STR_BLOCK.size()) == 0)
{
ERROR(std::string("not allowed to distribute ROM file '") + srcFileNamePath + "'");
}
}
}
void ROMFile::readDstFile()