Prevent uninitialized buffer
This commit is contained in:
parent
c159d9bda9
commit
02ea501c81
|
@ -12,10 +12,6 @@ void ErrorPopup::showAMSError() {
|
|||
title.setTypedText(T_ERROR_AMS);
|
||||
title.invalidate();
|
||||
switch (vehicle_state.last_ams_error.kind) {
|
||||
case AMS_ERROR_NONE:
|
||||
touchgfx::Unicode::strncpy(detailsBuffer, "UNKNOWN ERROR",
|
||||
sizeof(detailsBuffer) / sizeof(*detailsBuffer));
|
||||
break;
|
||||
case AMS_ERROR_SLAVE_TIMEOUT:
|
||||
touchgfx::Unicode::snprintf(
|
||||
detailsBuffer, sizeof(detailsBuffer) / sizeof(*detailsBuffer),
|
||||
|
@ -65,6 +61,11 @@ void ErrorPopup::showAMSError() {
|
|||
touchgfx::Unicode::strncpy(detailsBuffer, "Shunt overtemperature",
|
||||
sizeof(detailsBuffer) / sizeof(*detailsBuffer));
|
||||
break;
|
||||
case AMS_ERROR_NONE:
|
||||
default:
|
||||
touchgfx::Unicode::strncpy(detailsBuffer, "UNKNOWN ERROR",
|
||||
sizeof(detailsBuffer) / sizeof(*detailsBuffer));
|
||||
break;
|
||||
}
|
||||
details.setWildcard(detailsBuffer);
|
||||
details.invalidate();
|
||||
|
|
Loading…
Reference in New Issue