diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-12 01:40:54 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-12 01:40:54 +0000 |
commit | a9d5119825aef1cbca3d9f6931cedafbfc7bcaed (patch) | |
tree | a6563139b5f83cd365b64420a99142ad130adebc | |
parent | ea95cdb8e2012b21cd3a12f7062e851178c7f455 (diff) | |
download | openocd_libswd-a9d5119825aef1cbca3d9f6931cedafbfc7bcaed.tar.gz openocd_libswd-a9d5119825aef1cbca3d9f6931cedafbfc7bcaed.tar.bz2 openocd_libswd-a9d5119825aef1cbca3d9f6931cedafbfc7bcaed.tar.xz openocd_libswd-a9d5119825aef1cbca3d9f6931cedafbfc7bcaed.zip |
Improve handle_runtest_command:
- Use parse_uint helper to ensure argument is parsed properly.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2216 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r-- | src/jtag/tcl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 557b6602..5fc1bce2 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -1088,7 +1088,12 @@ static int handle_runtest_command(struct command_context_s *cmd_ctx, if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; - jtag_add_runtest(strtol(args[0], NULL, 0), jtag_get_end_state()); + unsigned num_clocks; + int retval = parse_uint(args[0], &num_clocks); + if (ERROR_OK != retval) + return retval; + + jtag_add_runtest(num_clocks, jtag_get_end_state()); jtag_execute_queue(); return ERROR_OK; |