From: oharboe at B. <oh...@ma...> - 2009-03-18 12:43:18
|
Author: oharboe Date: 2009-03-18 12:43:09 +0100 (Wed, 18 Mar 2009) New Revision: 1416 Modified: trunk/src/target/trace.c Log: Hiroshi Ito <it...@ml...> fix division by 0 Modified: trunk/src/target/trace.c =================================================================== --- trunk/src/target/trace.c 2009-03-17 10:22:26 UTC (rev 1415) +++ trunk/src/target/trace.c 2009-03-18 11:43:09 UTC (rev 1416) @@ -128,7 +128,11 @@ 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; |