X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Ftms470.c;h=50783148b35118a83c973ea7f3645372cf3a2d18;hb=20b29b7767097f999fe2eb4f7fb6c2917e9f66a6;hp=f1eba9cd332db6488dc3e746f6e00a8b6f1d9877;hpb=28c24a5c41c47a66e9310912f88148814f730a25;p=openocd.git diff --git a/src/flash/nor/tms470.c b/src/flash/nor/tms470.c index f1eba9cd33..50783148b3 100644 --- a/src/flash/nor/tms470.c +++ b/src/flash/nor/tms470.c @@ -296,9 +296,9 @@ COMMAND_HANDLER(tms470_handle_flash_keyset_command) int i; for (i = 0; i < 4; i++) { - int start = (0 == strncmp(CMD_ARGV[i], "0x", 2)) ? 2 : 0; + int start = (strncmp(CMD_ARGV[i], "0x", 2) == 0) ? 2 : 0; - if (1 != sscanf(&CMD_ARGV[i][start], "%" SCNx32 "", &flash_keys[i])) { + if (sscanf(&CMD_ARGV[i][start], "%" SCNx32 "", &flash_keys[i]) != 1) { command_print(CMD, "could not process flash key %s", CMD_ARGV[i]); LOG_ERROR("could not process flash key %s", CMD_ARGV[i]);