]> git.sur5r.net Git - openocd/commitdiff
Hiroshi Ito <ito@mlb.co.jp> fix division by 0
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 18 Mar 2009 11:43:09 +0000 (11:43 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Wed, 18 Mar 2009 11:43:09 +0000 (11:43 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1416 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/target/trace.c

index 257e8ceb8a767946fe655acf67b4b8d5d42fcbc9..93925cd1a4827e5a2eba46b95adaf133f932fd7a 100644 (file)
@@ -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;