Skip to content
Snippets Groups Projects
Commit 5d657571 authored by zwelch's avatar zwelch
Browse files

Use parse_uint helper to replace strtoul call in jtag_tap_by_string.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2212 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent d5339d2e
No related branches found
No related tags found
No related merge requests found
...@@ -172,9 +172,8 @@ jtag_tap_t *jtag_tap_by_string(const char *s) ...@@ -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 */ /* no tap found by name, so try to parse the name as a number */
char *cp; unsigned n;
unsigned n = strtoul(s, &cp, 0); if (parse_uint(s, &n) != ERROR_OK)
if ((s == cp) || (*cp != 0))
return NULL; return NULL;
return jtag_tap_by_position(n); return jtag_tap_by_position(n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment