diff options
-rw-r--r-- | src/jtag/core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index 4208167b..4c91abee 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -172,9 +172,8 @@ jtag_tap_t *jtag_tap_by_string(const char *s) } /* no tap found by name, so try to parse the name as a number */ - char *cp; - unsigned n = strtoul(s, &cp, 0); - if ((s == cp) || (*cp != 0)) + unsigned n; + if (parse_uint(s, &n) != ERROR_OK) return NULL; return jtag_tap_by_position(n); |