From c461e6d76b27b11284dda66316263696d5266764 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 23 Dec 2020 17:32:57 -0800 Subject: [clang-tidy] Fix bugprone string compare Found with bugprone-suspicious-string-compare Signed-off-by: Rosen Penev --- tools/idevicedebug.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tools/idevicedebug.c') diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c index c30b90e..7c9205f 100644 --- a/tools/idevicedebug.c +++ b/tools/idevicedebug.c @@ -406,7 +406,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); goto cleanup; } @@ -423,7 +423,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); goto cleanup; } @@ -439,7 +439,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); goto cleanup; } @@ -480,7 +480,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); goto cleanup; } @@ -514,7 +514,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); goto cleanup; } @@ -540,7 +540,7 @@ int main(int argc, char *argv[]) if (response) { log_debug("response: %s", response); - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { dres = debugserver_client_handle_response(debugserver_client, &response, &res); if (dres != DEBUGSERVER_E_SUCCESS) { log_debug("failed to process response; error %d; %s", dres, response); @@ -567,7 +567,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); } free(response); @@ -581,7 +581,7 @@ int main(int argc, char *argv[]) debugserver_command_free(command); command = NULL; if (response) { - if (strncmp(response, "OK", 2)) { + if (strncmp(response, "OK", 2) != NULL) { debugserver_client_handle_response(debugserver_client, &response, NULL); } free(response); -- cgit v1.1-32-gdbae