Skip to content

Commit 10610ce

Browse files
committed
Compare hide argument using strcmp.
The more intuitive expression (str1 == str2) compares memory locations and therefore will not return true unless the strings point to the same address (hint: they don't). Strcmp is the appropriate method for comparing string literals.
1 parent d44238d commit 10610ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Spectacle/Source/Main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void SaveParsedVersions(const TArray<FJson>& ParsedVersions)
9898
*/
9999
int main(int ArgumentCount, char* Arguments[])
100100
{
101-
if (ArgumentCount > 1 && Arguments[1] == "hidden")
101+
if (ArgumentCount > 1 && strcmp(Arguments[1], "hidden") == 0)
102102
{
103103
std::ofstream out("Log.txt");
104104
std::streambuf* coutbuf = std::cout.rdbuf();

0 commit comments

Comments
 (0)