Skip to content

Commit 1ec8bb9

Browse files
committedSep 11, 2023
fix: invalid calls
1 parent 935ba9b commit 1ec8bb9

6 files changed

+11
-10
lines changed
 

‎scenes/subbrute_scene_load_file.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void subbrute_scene_load_file_on_enter(void* context) {
1616
DialogsFileBrowserOptions browser_options;
1717
dialog_file_browser_set_basic_options(&browser_options, SUBBRUTE_FILE_EXT, &I_sub1_10px);
1818

19-
SubBruteFileResult load_result = SubBruteFileResultUnknown;
19+
SubBruteFileResult load_result;
2020
// TODO: DELETE IT
2121
#ifdef SUBBRUTE_FAST_TRACK
2222
bool res = true;

‎scenes/subbrute_scene_save_name.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bool subbrute_scene_save_name_on_event(void* context, SceneManagerEvent event) {
4747
FURI_LOG_D(TAG, "Saving: %s", instance->text_store);
4848
#endif
4949
bool success = false;
50-
if(strcmp(instance->text_store, "")) {
50+
if(strcmp(instance->text_store, "") != 0) {
5151
furi_string_reset(instance->file_path);
5252
furi_string_cat_printf(
5353
instance->file_path,

‎scenes/subbrute_scene_setup_extra.c

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ static void subbrute_scene_setup_extra_init_var_list(SubBruteState* instance, bo
245245
}
246246
} else {
247247
item = variable_item_list_add(var_list, "Show Extra", 0, NULL, NULL);
248+
variable_item_set_current_value_index(item, 0);
248249
}
249250

250251
variable_item_list_set_enter_callback(var_list, setup_extra_enter_callback, instance);

‎subbrute_device.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ uint8_t subbrute_device_load_from_file(SubBruteDevice* instance, const char* fil
226226
#ifdef FURI_DEBUG
227227
FURI_LOG_D(TAG, "subbrute_device_load_from_file: %s", file_path);
228228
#endif
229-
SubBruteFileResult result = SubBruteFileResultUnknown;
229+
SubBruteFileResult result;
230230

231231
Storage* storage = furi_record_open(RECORD_STORAGE);
232232
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
335335
break;
336336
}
337337
uint64_t data = 0;
338-
for(uint8_t i = 0; i < sizeof(uint64_t); i++) {
338+
for(size_t i = 0; i < sizeof(uint64_t); i++) {
339339
data = (data << 8) | key_data[i];
340340
}
341341
#if FURI_DEBUG

‎subbrute_protocols.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ void subbrute_protocol_create_candidate_for_existing_file(
583583
uint8_t high_byte = (step >> 8) & 0xff;
584584

585585
size_t size = sizeof(uint64_t);
586-
for(uint8_t i = 0; i < size; i++) {
586+
for(size_t i = 0; i < size; i++) {
587587
if(i == bit_index - 1 && two_bytes) {
588588
furi_string_cat_printf(candidate, "%02X %02X", high_byte, low_byte);
589589
i++;
@@ -618,7 +618,7 @@ void subbrute_protocol_create_candidate_for_default(
618618
uint64_t total = 0;
619619
for(size_t j = 0; j < 8; j++) {
620620
total |= lut[step % 3] << (2 * j);
621-
double sub_step = step / 3;
621+
double sub_step = (double)step / 3;
622622
step = (uint64_t)floor(sub_step);
623623
}
624624
total <<= 9;
@@ -635,7 +635,7 @@ void subbrute_protocol_create_candidate_for_default(
635635
uint64_t total = 0;
636636
for(size_t j = 0; j < 8; j++) {
637637
total |= lut[step % 3] << (2 * j);
638-
double sub_step = step / 3;
638+
double sub_step = (double)step / 3;
639639
step = (uint64_t)floor(sub_step);
640640
}
641641
total <<= 9;
@@ -654,7 +654,7 @@ void subbrute_protocol_create_candidate_for_default(
654654
uint64_t total = 0;
655655
for(size_t j = 0; j < 8; j++) {
656656
total |= lut[step % 3] << (2 * j);
657-
double sub_step = step / 3;
657+
double sub_step = (double)step / 3;
658658
step = (uint64_t)floor(sub_step);
659659
}
660660
total <<= 8;
@@ -670,7 +670,7 @@ void subbrute_protocol_create_candidate_for_default(
670670
}
671671

672672
size_t size = sizeof(uint64_t);
673-
for(uint8_t i = 0; i < size; i++) {
673+
for(size_t i = 0; i < size; i++) {
674674
if(p[i] != 0) {
675675
furi_string_cat_printf(candidate, "%02X", p[i]);
676676
} else {

‎views/subbrute_attack_view.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void subbrute_attack_view_draw(Canvas* canvas, void* context) {
328328
canvas, x - icon_width_with_offset, y - icon_v_offset, model->icon);
329329
// Progress bar
330330
// Resolution: 128x64 px
331-
float progress_value = (float)model->current_step / model->max_value;
331+
float progress_value = (float)model->current_step / (float)model->max_value;
332332
elements_progress_bar(canvas, 8, 37, 110, progress_value > 1 ? 1 : progress_value);
333333

334334
snprintf(

0 commit comments

Comments
 (0)
Please sign in to comment.