Skip to content

Commit 064b6a0

Browse files
authored
fix string comparison
1 parent cd521fb commit 064b6a0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

HideTaskbar.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ void MainLoop() {
6060

6161
#ifdef NDEBUG
6262
int WinMain(HINSTANCE _instance_handle, HINSTANCE _prev_instance_handle, LPSTR cmd_line, int _show_cmd) {
63-
if (cmd_line == "--hide") {
63+
if (cmd_line && strcmp(cmd_line, "--hide") == 0) {
6464
SetTaskbarsHidden(true);
6565
return 0;
6666
}
6767

68-
if (cmd_line == "--show") {
68+
if (cmd_line && strcmp(cmd_line, "--show") == 0) {
6969
SetTaskbarsHidden(false);
7070
return 0;
7171
}
@@ -76,16 +76,17 @@ int WinMain(HINSTANCE _instance_handle, HINSTANCE _prev_instance_handle, LPSTR c
7676
#else
7777
int main(int argc, char* argv[])
7878
{
79-
if (argv[1] == "--hide") {
79+
if (argc > 1 && strcmp(argv[1], "--hide") == 0) {
8080
SetTaskbarsHidden(true);
8181
return 0;
8282
}
8383

84-
if (argv[1] == "--show") {
84+
if (argc > 1 && strcmp(argv[1], "--show") == 0) {
8585
SetTaskbarsHidden(false);
8686
return 0;
8787
}
8888

8989
MainLoop();
90+
return 0;
9091
}
91-
#endif
92+
#endif

0 commit comments

Comments
 (0)