From 04b8a2a6f3e85fc701ce19c8c5999ab8a75964cd Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Sat, 24 Oct 2009 06:36:06 -0700 Subject: [PATCH] Improve trace command argument parsing. --- src/target/trace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/target/trace.c b/src/target/trace.c index 9387f830..e74c6160 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -86,7 +86,9 @@ static int handle_trace_point_command(struct command_context_s *cmd_ctx, char *c trace->trace_points_size += 32; } - trace->trace_points[trace->num_trace_points].address = strtoul(args[0], NULL, 0); + uint32_t address; + COMMAND_PARSE_NUMBER(u32, args[0], address); + trace->trace_points[trace->num_trace_points].address = address; trace->trace_points[trace->num_trace_points].hit_counter = 0; trace->num_trace_points++; @@ -112,7 +114,7 @@ static int handle_trace_history_command(struct command_context_s *cmd_ctx, char if (trace->trace_history) free(trace->trace_history); - trace->trace_history_size = strtoul(args[0], NULL, 0); + COMMAND_PARSE_NUMBER(u32, args[0], trace->trace_history_size); trace->trace_history = malloc(sizeof(uint32_t) * trace->trace_history_size); command_print(cmd_ctx, "new trace history size: %i", (int)(trace->trace_history_size)); -- 2.39.5