فهرست منبع

fix: invalid calls

DerSkythe 2 سال پیش
والد
کامیت
1ec8bb919d

+ 1 - 1
scenes/subbrute_scene_load_file.c

@@ -16,7 +16,7 @@ void subbrute_scene_load_file_on_enter(void* context) {
     DialogsFileBrowserOptions browser_options;
     dialog_file_browser_set_basic_options(&browser_options, SUBBRUTE_FILE_EXT, &I_sub1_10px);
 
-    SubBruteFileResult load_result = SubBruteFileResultUnknown;
+    SubBruteFileResult load_result;
     // TODO: DELETE IT
 #ifdef SUBBRUTE_FAST_TRACK
     bool res = true;

+ 1 - 1
scenes/subbrute_scene_save_name.c

@@ -47,7 +47,7 @@ bool subbrute_scene_save_name_on_event(void* context, SceneManagerEvent event) {
         FURI_LOG_D(TAG, "Saving: %s", instance->text_store);
 #endif
         bool success = false;
-        if(strcmp(instance->text_store, "")) {
+        if(strcmp(instance->text_store, "") != 0) {
             furi_string_reset(instance->file_path);
             furi_string_cat_printf(
                 instance->file_path,

+ 1 - 0
scenes/subbrute_scene_setup_extra.c

@@ -245,6 +245,7 @@ static void subbrute_scene_setup_extra_init_var_list(SubBruteState* instance, bo
         }
     } else {
         item = variable_item_list_add(var_list, "Show Extra", 0, NULL, NULL);
+        variable_item_set_current_value_index(item, 0);
     }
 
     variable_item_list_set_enter_callback(var_list, setup_extra_enter_callback, instance);

+ 2 - 2
subbrute_device.c

@@ -226,7 +226,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, const char* fil
 #ifdef FURI_DEBUG
     FURI_LOG_D(TAG, "subbrute_device_load_from_file: %s", file_path);
 #endif
-    SubBruteFileResult result = SubBruteFileResultUnknown;
+    SubBruteFileResult result;
 
     Storage* storage = furi_record_open(RECORD_STORAGE);
     FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
@@ -335,7 +335,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, const char* fil
             break;
         }
         uint64_t data = 0;
-        for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
+        for(size_t i = 0; i < sizeof(uint64_t); i++) {
             data = (data << 8) | key_data[i];
         }
 #if FURI_DEBUG

+ 5 - 5
subbrute_protocols.c

@@ -583,7 +583,7 @@ void subbrute_protocol_create_candidate_for_existing_file(
     uint8_t high_byte = (step >> 8) & 0xff;
 
     size_t size = sizeof(uint64_t);
-    for(uint8_t i = 0; i < size; i++) {
+    for(size_t i = 0; i < size; i++) {
         if(i == bit_index - 1 && two_bytes) {
             furi_string_cat_printf(candidate, "%02X %02X", high_byte, low_byte);
             i++;
@@ -618,7 +618,7 @@ void subbrute_protocol_create_candidate_for_default(
         uint64_t total = 0;
         for(size_t j = 0; j < 8; j++) {
             total |= lut[step % 3] << (2 * j);
-            double sub_step = step / 3;
+            double sub_step = (double)step / 3;
             step = (uint64_t)floor(sub_step);
         }
         total <<= 9;
@@ -635,7 +635,7 @@ void subbrute_protocol_create_candidate_for_default(
         uint64_t total = 0;
         for(size_t j = 0; j < 8; j++) {
             total |= lut[step % 3] << (2 * j);
-            double sub_step = step / 3;
+            double sub_step = (double)step / 3;
             step = (uint64_t)floor(sub_step);
         }
         total <<= 9;
@@ -654,7 +654,7 @@ void subbrute_protocol_create_candidate_for_default(
         uint64_t total = 0;
         for(size_t j = 0; j < 8; j++) {
             total |= lut[step % 3] << (2 * j);
-            double sub_step = step / 3;
+            double sub_step = (double)step / 3;
             step = (uint64_t)floor(sub_step);
         }
         total <<= 8;
@@ -670,7 +670,7 @@ void subbrute_protocol_create_candidate_for_default(
     }
 
     size_t size = sizeof(uint64_t);
-    for(uint8_t i = 0; i < size; i++) {
+    for(size_t i = 0; i < size; i++) {
         if(p[i] != 0) {
             furi_string_cat_printf(candidate, "%02X", p[i]);
         } else {

+ 1 - 1
views/subbrute_attack_view.c

@@ -328,7 +328,7 @@ void subbrute_attack_view_draw(Canvas* canvas, void* context) {
             canvas, x - icon_width_with_offset, y - icon_v_offset, model->icon);
         // Progress bar
         // Resolution: 128x64 px
-        float progress_value = (float)model->current_step / model->max_value;
+        float progress_value = (float)model->current_step / (float)model->max_value;
         elements_progress_bar(canvas, 8, 37, 110, progress_value > 1 ? 1 : progress_value);
 
         snprintf(