From: oharboe Date: Wed, 18 Mar 2009 11:43:09 +0000 (+0000) Subject: Hiroshi Ito fix division by 0 X-Git-Tag: v0.2.0~1086 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cf10427caa55be47a6c93976883b595cf2c5be52;p=openocd Hiroshi Ito fix division by 0 git-svn-id: svn://svn.berlios.de/openocd/trunk@1416 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- 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;