diff options
author | Rosen Penev | 2020-12-23 17:32:57 -0800 |
---|---|---|
committer | Nikias Bassen | 2022-04-22 16:30:45 +0200 |
commit | c461e6d76b27b11284dda66316263696d5266764 (patch) | |
tree | 3d612fc904046a381438cf008448aaf4a1424f10 /tools | |
parent | 95316d81633120244d53b85303447beb1a917f74 (diff) | |
download | libimobiledevice-c461e6d76b27b11284dda66316263696d5266764.tar.gz libimobiledevice-c461e6d76b27b11284dda66316263696d5266764.tar.bz2 |
[clang-tidy] Fix bugprone string compare
Found with bugprone-suspicious-string-compare
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicebackup.c | 4 | ||||
-rw-r--r-- | tools/idevicedebug.c | 16 | ||||
-rw-r--r-- | tools/idevicepair.c | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 483f3d6..1e512d8 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -533,7 +533,7 @@ static int mobilebackup_check_file_integrity(const char *backup_directory, const for ( i = 0; i < 20; i++, p += 2 ) { snprintf (p, 3, "%02x", (unsigned char)fnhash[i] ); } - if (strcmp(fnamehash, hash)) { + if (strcmp(fnamehash, hash) != 0) { printf("\r\n"); printf("WARNING: filename hash does not match for entry '%s'\n", hash); } @@ -544,7 +544,7 @@ static int mobilebackup_check_file_integrity(const char *backup_directory, const plist_get_string_val(node, &auth_version); } - if (strcmp(auth_version, "1.0")) { + if (strcmp(auth_version, "1.0") != 0) { printf("\r\n"); printf("WARNING: Unknown AuthVersion '%s', DataHash cannot be verified!\n", auth_version); } 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); diff --git a/tools/idevicepair.c b/tools/idevicepair.c index a2dc944..f42f498 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c @@ -411,7 +411,7 @@ int main(int argc, char **argv) result = EXIT_FAILURE; goto leave; } else { - if (strcmp("com.apple.mobile.lockdown", type)) { + if (strcmp("com.apple.mobile.lockdown", type) != 0) { printf("WARNING: QueryType request returned '%s'\n", type); } free(type); |