From cf10427caa55be47a6c93976883b595cf2c5be52 Mon Sep 17 00:00:00 2001 From: oharboe Date: Wed, 18 Mar 2009 11:43:09 +0000 Subject: [PATCH] Hiroshi Ito fix division by 0 git-svn-id: svn://svn.berlios.de/openocd/trunk@1416 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/trace.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/target/trace.c b/src/target/trace.c index 257e8ceb..93925cd1 100644 --- a/src/target/trace.c +++ b/src/target/trace.c @@ -128,7 +128,11 @@ int handle_trace_history_command(struct command_context_s *cmd_ctx, char *cmd, c int i; int first = 0; int last = trace->trace_history_pos; - + + if ( !trace->trace_history_size ) { + command_print(cmd_ctx, "trace history buffer is not allocated"); + return ERROR_OK; + } if (trace->trace_history_overflowed) { first = trace->trace_history_pos; -- 2.39.5