make BOM checks more correct (& to &&)

This commit is contained in:
somewhatlurker
2019-09-14 16:08:38 +10:00
parent 1242b608bb
commit 623cb80e0b
2 changed files with 4 additions and 4 deletions
@@ -248,7 +248,7 @@ bool IsLineInFile(LPCSTR searchLine, LPCWSTR fileName)
// check for BOM
std::getline(fileStream, line);
if (line.size() >= 3 & line.rfind("\xEF\xBB\xBF", 0) == 0)
if (line.size() >= 3 && line.rfind("\xEF\xBB\xBF", 0) == 0)
fileStream.seekg(3);
else
fileStream.seekg(0);
@@ -284,7 +284,7 @@ void PrependFile(LPCSTR newStr, LPCWSTR fileName)
// check for BOM
std::string BOMcheckLine;
std::getline(fileStream, BOMcheckLine);
if (BOMcheckLine.size() >= 3 & BOMcheckLine.rfind("\xEF\xBB\xBF", 0) == 0)
if (BOMcheckLine.size() >= 3 && BOMcheckLine.rfind("\xEF\xBB\xBF", 0) == 0)
fileStream.seekg(3);
else
fileStream.seekg(0);
@@ -53,7 +53,7 @@ namespace TLAC::FileSystem
// check for BOM
std::getline(fileStream, line);
if (line.size() >= 3 & line.rfind("\xEF\xBB\xBF", 0) == 0)
if (line.size() >= 3 && line.rfind("\xEF\xBB\xBF", 0) == 0)
fileStream.seekg(3);
else
fileStream.seekg(0);
@@ -74,6 +74,6 @@ namespace TLAC::FileSystem
bool ConfigFile::IsComment(const std::string &line)
{
return line.size() <= 0 || line[0] == '#' || line[0] == '[' || (line.size() >= 2 & line.rfind("//", 0) == 0);
return line.size() <= 0 || line[0] == '#' || line[0] == '[' || (line.size() >= 2 && line.rfind("//", 0) == 0);
}
}