Fix cyfral crashes

This commit is contained in:
Astra 2024-04-27 15:53:19 +09:00
parent 42c69b076a
commit 379e8d2a6a

View file

@ -325,7 +325,7 @@ static LevelDuration protocol_cyfral_encoder_yield(ProtocolCyfral* proto) {
return result; return result;
} }
static void protocol_cyfral_render_uid(FuriString* result, ProtocolCyfral* proto) { static void protocol_cyfral_render_uid(ProtocolCyfral* proto, FuriString* result) {
furi_string_cat_printf(result, "ID: "); furi_string_cat_printf(result, "ID: ");
for(size_t i = 0; i < CYFRAL_DATA_SIZE; ++i) { for(size_t i = 0; i < CYFRAL_DATA_SIZE; ++i) {
furi_string_cat_printf(result, "%02X ", ((uint8_t*)&proto->data)[i]); furi_string_cat_printf(result, "%02X ", ((uint8_t*)&proto->data)[i]);
@ -333,10 +333,7 @@ static void protocol_cyfral_render_uid(FuriString* result, ProtocolCyfral* proto
} }
static void protocol_cyfral_render_brief_data(ProtocolCyfral* proto, FuriString* result) { static void protocol_cyfral_render_brief_data(ProtocolCyfral* proto, FuriString* result) {
furi_string_cat_printf(result, "ID: "); protocol_cyfral_render_uid(proto, result);
for(size_t i = 0; i < CYFRAL_DATA_SIZE; ++i) {
furi_string_cat_printf(result, "%02X ", ((uint8_t*)&proto->data)[i]);
}
} }
const ProtocolBase ibutton_protocol_misc_cyfral = { const ProtocolBase ibutton_protocol_misc_cyfral = {