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
This commit is contained in:
parent
d5339d2eb4
commit
5d657571cb
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue