From 7b335536e238c8032d045e43abf33f433035c0b3 Mon Sep 17 00:00:00 2001 From: "Jasper v. Blanckenburg" Date: Mon, 22 May 2023 05:52:11 +0200 Subject: [PATCH] Fix crash when displaying slave panic --- TouchGFX/gui/src/containers/ErrorPopup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TouchGFX/gui/src/containers/ErrorPopup.cpp b/TouchGFX/gui/src/containers/ErrorPopup.cpp index e117fc2..7687e40 100644 --- a/TouchGFX/gui/src/containers/ErrorPopup.cpp +++ b/TouchGFX/gui/src/containers/ErrorPopup.cpp @@ -38,13 +38,15 @@ void ErrorPopup::showAMSError() { case AMS_SLAVEPANIC_OPENWIRE: panicKindStr = "OPEN WIRE"; break; + default: + panicKindStr = "UNKNOWN"; } touchgfx::Unicode::UnicodeChar panicKindBuf[32]; touchgfx::Unicode::strncpy(panicKindBuf, panicKindStr, sizeof(panicKindBuf) / sizeof(*panicKindBuf)); touchgfx::Unicode::snprintf( detailsBuffer, sizeof(detailsBuffer) / sizeof(*detailsBuffer), - "Slave panic: Slave %d\n[ID: %d, Kind: %s, Arg: %08x]", + "Slave panic:\n[ID: %d, Kind: %s, Arg: %08x]", vehicle_state.last_ams_slave_panic.id, panicKindBuf, vehicle_state.last_ams_slave_panic.arg); break;