Skip to content

Commit 8a1192f

Browse files
committed
refactor(clang-tidy): fix bugprone-suspicious-string-compare
1 parent 3577e04 commit 8a1192f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Core/GameEngineDevice/Source/Win32Device/Common/Win32LocalFileSystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void Win32LocalFileSystem::getFileListInDirectory(const AsciiString& currentDire
139139

140140
while (!done) {
141141
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
142-
(strcmp(findData.cFileName, ".") != 0 && strcmp(findData.cFileName, ".."))) {
142+
(strcmp(findData.cFileName, ".") != 0 && strcmp(findData.cFileName, "..") != 0)) {
143143
// if we haven't already, add this filename to the list.
144144
// a stl set should only allow one copy of each filename
145145
AsciiString newFilename;
@@ -165,7 +165,7 @@ void Win32LocalFileSystem::getFileListInDirectory(const AsciiString& currentDire
165165

166166
while (!done) {
167167
if ((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
168-
(strcmp(findData.cFileName, ".") != 0 && strcmp(findData.cFileName, ".."))) {
168+
(strcmp(findData.cFileName, ".") != 0 && strcmp(findData.cFileName, "..") != 0)) {
169169

170170
AsciiString tempsearchstr;
171171
tempsearchstr.concat(currentDirectory);

Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,7 @@ Font3DDataClass * WW3DAssetManager::Get_Font3DData( const char *name )
13701370
// loop through and see if the Font3D we are looking for has already been
13711371
// allocated and thus we can just return it.
13721372
for ( SLNode<Font3DDataClass> *node = Font3DDatas.Head(); node; node = node->Next()) {
1373-
if (!stricmp(name, node->Data()->Name)) {
1373+
if (stricmp(name, node->Data()->Name) == 0) {
13741374
node->Data()->Add_Ref();
13751375
return node->Data();
13761376
}

0 commit comments

Comments
 (0)