targets/plc_debug.c
changeset 502 5343ae43f6d0
parent 491 28afed8b1af5
child 504 688e84df3408
--- 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;
 }