Spring cleaning

This commit is contained in:
Willy-JL
2025-04-04 13:18:36 +01:00
parent 32ad9ea25b
commit 81581c79b5
17 changed files with 39 additions and 138 deletions
+1 -3
View File
@@ -832,9 +832,7 @@ void elf_file_free(ELFFile* elf) {
const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it);
aligned_free(itref->value.data);
if(itref->value.fast_rel) {
if(itref->value.fast_rel->data) {
aligned_free(itref->value.fast_rel->data);
}
aligned_free(itref->value.fast_rel->data);
free(itref->value.fast_rel);
}
free((void*)itref->key);
+2 -2
View File
@@ -25,8 +25,8 @@
const ProtocolBase* const lfrfid_protocols[] = {
[LFRFIDProtocolEM4100] = &protocol_em4100,
[LFRFIDProtocolEM4100_32] = &protocol_em4100_32,
[LFRFIDProtocolEM4100_16] = &protocol_em4100_16,
[LFRFIDProtocolEM410032] = &protocol_em4100_32,
[LFRFIDProtocolEM410016] = &protocol_em4100_16,
[LFRFIDProtocolElectra] = &protocol_electra,
[LFRFIDProtocolH10301] = &protocol_h10301,
[LFRFIDProtocolIdteck] = &protocol_idteck,
+2 -2
View File
@@ -10,8 +10,8 @@ typedef enum {
typedef enum {
LFRFIDProtocolEM4100,
LFRFIDProtocolEM4100_32,
LFRFIDProtocolEM4100_16,
LFRFIDProtocolEM410032,
LFRFIDProtocolEM410016,
LFRFIDProtocolElectra,
LFRFIDProtocolH10301,
LFRFIDProtocolIdteck,
+1 -1
View File
@@ -13,7 +13,7 @@
#include <flipper_application/flipper_application.h>
#define SUBGHZ_RADIO_DEVICE_PLUGIN_APP_ID "subghz_radio_device"
#define SUBGHZ_RADIO_DEVICE_PLUGIN_API_VERSION 2
#define SUBGHZ_RADIO_DEVICE_PLUGIN_API_VERSION 1
typedef struct SubGhzDeviceRegistry SubGhzDeviceRegistry;
typedef struct SubGhzDevice SubGhzDevice;
+4 -9
View File
@@ -88,17 +88,12 @@ bool saved_struct_load(const char* path, void* data, size_t size, uint8_t magic,
}
if(result) {
size_t bytes_expected = sizeof(SavedStructHeader) + size;
uint64_t bytes_file = storage_file_size(file);
result = bytes_file == bytes_expected;
if(result) {
size_t bytes_count = storage_file_read(file, &header, sizeof(SavedStructHeader));
bytes_count += storage_file_read(file, data_read, size);
result = bytes_count == bytes_expected;
}
size_t bytes_count = storage_file_read(file, &header, sizeof(SavedStructHeader));
bytes_count += storage_file_read(file, data_read, size);
if(!result) {
if(bytes_count != (sizeof(SavedStructHeader) + size)) {
FURI_LOG_E(TAG, "Size mismatch of file \"%s\"", path);
result = false;
}
}