From: zwelch Date: Fri, 12 Jun 2009 01:40:29 +0000 (+0000) Subject: Use parse_uint helper to replace strtoul call in jtag_tap_by_string. X-Git-Tag: v0.2.0~303 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5d657571cbca31d29eae3a8e3258e5933afc3f01;p=openocd 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 --- 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);