From 5d657571cbca31d29eae3a8e3258e5933afc3f01 Mon Sep 17 00:00:00 2001 From: zwelch Date: Fri, 12 Jun 2009 01:40:29 +0000 Subject: [PATCH] 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 --- src/jtag/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jtag/core.c b/src/jtag/core.c index 4208167b4..4c91abeee 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);