Skip to content

Commit 4ded47a

Browse files
authored
Revert "Update t5577_writer.c"
1 parent 5f07eee commit 4ded47a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t5577_writer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void initialize_model(T5577WriterModel* model) {
112112
model->user_block_num = 1;
113113
model->edit_block_slc = 1;
114114
model->writing_repeat_times = 0;
115-
for(uint32_t i = 0; i <= LFRFID_T5577_BLOCK_COUNT; i++) {
115+
for(uint32_t i = 0; i < LFRFID_T5577_BLOCK_COUNT; i++) {
116116
model->content[i] = 0;
117117
}
118118
memset(model->data_loaded, false, sizeof(model->data_loaded));
@@ -240,7 +240,7 @@ static void t5577_writer_user_block_num_change(VariableItem* item) {
240240
FuriString *buffer = furi_string_alloc();
241241
furi_string_printf(buffer, "%u", model->user_block_num);
242242
variable_item_set_current_value_text(item, furi_string_get_cstr(buffer));
243-
for(uint8_t i = model->user_block_num; i <= LFRFID_T5577_BLOCK_COUNT; i++) {
243+
for(uint8_t i = model->user_block_num; i < LFRFID_T5577_BLOCK_COUNT; i++) {
244244
model->content[i] = 0; // pad the unneeded blocks with zeros
245245
}
246246
furi_string_free(buffer);
@@ -327,7 +327,7 @@ static void t5577_writer_file_saver(void* context) {
327327
furi_string_printf(buffer, "Number of User Blocks: %u\n", model->user_block_num);
328328
storage_file_write(data_file, furi_string_get_cstr(buffer), furi_string_size(buffer));
329329
furi_string_printf(buffer, "\nRaw Data:\n");
330-
for (int i = 0; i <= LFRFID_T5577_BLOCK_COUNT; i++)
330+
for (int i = 0; i < LFRFID_T5577_BLOCK_COUNT; i++)
331331
{
332332
furi_string_cat_printf(
333333
buffer,
@@ -872,4 +872,4 @@ int32_t main_t5577_writer_app(void* _p) {
872872

873873
t5577_writer_app_free(app);
874874
return 0;
875-
}
875+
}

0 commit comments

Comments
 (0)