rp: atoi() -> strtoul() to fix the clang-tidy warning and improve robustness and correctness

This commit is contained in:
dragonmux 2022-07-31 16:38:13 +01:00 committed by Piotr Esden-Tempski
parent efb2e99408
commit 982d1ac847
1 changed files with 2 additions and 2 deletions

View File

@ -514,9 +514,9 @@ static bool rp_cmd_reset_usb_boot(target *t, int argc, const char **argv)
{
struct rp_priv_s *ps = (struct rp_priv_s *)t->target_storage;
if (argc > 2) {
ps->regs[1] = atoi(argv[2]);
ps->regs[1] = strtoul(argv[2], NULL, 0);
} else if (argc < 3) {
ps->regs[0] = atoi(argv[1]);
ps->regs[0] = strtoul(argv[1], NULL, 0);
} else {
ps->regs[0] = 0;
ps->regs[1] = 0;