Fix usage of possibly uninitialized 'result'.
Can't tell how gcc/clang fail to detect this…
This commit is contained in:
parent
dfcabf71f0
commit
2256d5d3dc
1 changed files with 6 additions and 6 deletions
|
@ -97,27 +97,27 @@ main (int argc, const char *argv[])
|
||||||
// Result of Diagnose ping for RC-S360 doesn't contain status byte so we've to handle both cases
|
// Result of Diagnose ping for RC-S360 doesn't contain status byte so we've to handle both cases
|
||||||
result = (memcmp (pncmd_diagnose_communication_line_test + 1, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 1) == 0) ||
|
result = (memcmp (pncmd_diagnose_communication_line_test + 1, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 1) == 0) ||
|
||||||
(memcmp (pncmd_diagnose_communication_line_test + 2, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 2) == 0);
|
(memcmp (pncmd_diagnose_communication_line_test + 2, abtRx, sizeof (pncmd_diagnose_communication_line_test) - 2) == 0);
|
||||||
} else {
|
|
||||||
nfc_perror (pnd, "pn53x_transceive");
|
|
||||||
}
|
|
||||||
printf (" Communication line test: %s\n", result ? "OK" : "Failed");
|
printf (" Communication line test: %s\n", result ? "OK" : "Failed");
|
||||||
|
} else {
|
||||||
|
nfc_perror (pnd, "pn53x_transceive: cannot diagnose communication line");
|
||||||
|
}
|
||||||
|
|
||||||
res = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, szRx, 0);
|
res = pn53x_transceive (pnd, pncmd_diagnose_rom_test, sizeof (pncmd_diagnose_rom_test), abtRx, szRx, 0);
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
szRx = (size_t) res;
|
szRx = (size_t) res;
|
||||||
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
||||||
} else {
|
|
||||||
nfc_perror (pnd, "pn53x_transceive");
|
|
||||||
}
|
|
||||||
printf (" ROM test: %s\n", result ? "OK" : "Failed");
|
printf (" ROM test: %s\n", result ? "OK" : "Failed");
|
||||||
|
} else {
|
||||||
|
nfc_perror (pnd, "pn53x_transceive: cannot diagnose ROM");
|
||||||
|
}
|
||||||
|
|
||||||
res = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, szRx, 0);
|
res = pn53x_transceive (pnd, pncmd_diagnose_ram_test, sizeof (pncmd_diagnose_ram_test), abtRx, szRx, 0);
|
||||||
if (res > 0) {
|
if (res > 0) {
|
||||||
szRx = (size_t) res;
|
szRx = (size_t) res;
|
||||||
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
result = ((szRx == 1) && (abtRx[0] == 0x00));
|
||||||
} else {
|
|
||||||
nfc_perror (pnd, "pn53x_transceive");
|
|
||||||
}
|
|
||||||
printf (" RAM test: %s\n", result ? "OK" : "Failed");
|
printf (" RAM test: %s\n", result ? "OK" : "Failed");
|
||||||
|
} else {
|
||||||
|
nfc_perror (pnd, "pn53x_transceive: cannot diagnose RAM");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue