t

Fork of mbed-dev by mbed official

Revision:
168:e84263d55307
Parent:
160:d5399cc887bb
--- a/platform/mbed_error.c	Thu Jun 08 15:02:37 2017 +0100
+++ b/platform/mbed_error.c	Wed Jun 21 17:46:44 2017 +0100
@@ -23,7 +23,16 @@
 #include <stdio.h>
 #endif
 
+static uint8_t error_in_progress = 0;
+
 WEAK void error(const char* format, ...) {
+
+    // Prevent recursion if error is called again
+    if (error_in_progress) {
+        return;
+    }
+    error_in_progress = 1;
+
 #ifndef NDEBUG
     va_list arg;
     va_start(arg, format);