rp: atoi() -> strtoul() to fix the clang-tidy warning and improve robustness and correctness
This commit is contained in:
parent
efb2e99408
commit
982d1ac847
|
@ -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;
|
struct rp_priv_s *ps = (struct rp_priv_s *)t->target_storage;
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
ps->regs[1] = atoi(argv[2]);
|
ps->regs[1] = strtoul(argv[2], NULL, 0);
|
||||||
} else if (argc < 3) {
|
} else if (argc < 3) {
|
||||||
ps->regs[0] = atoi(argv[1]);
|
ps->regs[0] = strtoul(argv[1], NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
ps->regs[0] = 0;
|
ps->regs[0] = 0;
|
||||||
ps->regs[1] = 0;
|
ps->regs[1] = 0;
|
||||||
|
|
Loading…
Reference in New Issue