diff -r d7bf56b036a8 -r 5343ae43f6d0 targets/plc_debug.c --- a/targets/plc_debug.c Thu Dec 10 12:31:42 2009 +0100 +++ b/targets/plc_debug.c Thu Dec 10 14:57:27 2009 +0100 @@ -279,8 +279,10 @@ /* Wait until debug data ready and return pointer to it */ int GetDebugData(unsigned long *tick, unsigned long *size, void **buffer){ int res = WaitDebugData(tick); - *size = buffer_cursor - debug_buffer; - *buffer = debug_buffer; + if(res){ + *size = buffer_cursor - debug_buffer; + *buffer = debug_buffer; + } return res; }