From 982d1ac847401225c1469628a9a1ee98f9c8dcf6 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Sun, 31 Jul 2022 16:38:13 +0100 Subject: [PATCH] rp: atoi() -> strtoul() to fix the clang-tidy warning and improve robustness and correctness --- src/target/rp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/rp.c b/src/target/rp.c index 5556b45..3c4c193 100644 --- a/src/target/rp.c +++ b/src/target/rp.c @@ -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;