gcc11 is smart

This commit is contained in:
rusefillc 2022-10-19 10:29:27 -04:00
parent 38639e8877
commit c376d4de90
1 changed files with 4 additions and 2 deletions

View File

@ -271,8 +271,10 @@ void firmwareError(obd_code_e code, const char *fmt, ...) {
}
auto sramState = getBackupSram();
strncpy(sramState->ErrorString, criticalErrorMessageBuffer, efi::size(sramState->ErrorString));
sramState->Cookie = ErrorCookie::FirmwareError;
if (sramState != nullptr) {
strncpy(sramState->ErrorString, criticalErrorMessageBuffer, efi::size(sramState->ErrorString));
sramState->Cookie = ErrorCookie::FirmwareError;
}
#else
char errorBuffer[200];