]> git.sur5r.net Git - openocd/commitdiff
Improve handle_runtest_command:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 12 Jun 2009 01:40:54 +0000 (01:40 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 12 Jun 2009 01:40:54 +0000 (01:40 +0000)
- 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

src/jtag/tcl.c

index 557b660290626017c873dd378f7b6e5797e10b84..5fc1bce21c264acc22c1dd80705ca30ece854ca5 100644 (file)
@@ -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;