summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-12 01:40:29 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-12 01:40:29 +0000
commit5d657571cbca31d29eae3a8e3258e5933afc3f01 (patch)
treebcadd54919891ff81f2467bb109b60e6f9629fca
parentd5339d2eb49930a60bafc5908045303ee8ad3e00 (diff)
downloadopenocd_libswd-5d657571cbca31d29eae3a8e3258e5933afc3f01.tar.gz
openocd_libswd-5d657571cbca31d29eae3a8e3258e5933afc3f01.tar.bz2
openocd_libswd-5d657571cbca31d29eae3a8e3258e5933afc3f01.tar.xz
openocd_libswd-5d657571cbca31d29eae3a8e3258e5933afc3f01.zip
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
-rw-r--r--src/jtag/core.c5
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);