Skip to content

Commit

Permalink
free logs once written. Check length of logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbrodude6119 committed Jul 4, 2023
1 parent 9c46c56 commit 8e2487b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions evil_portal_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static int32_t uart_worker(void *context) {
strcat(uart->app->portal_logs, (char *)uart->rx_buf);
if (strlen(uart->app->portal_logs) > 4000) {
write_logs(uart->app->portal_logs);
free(uart->app->portal_logs);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion scenes/evil_portal_scene_console_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ void evil_portal_scene_console_output_on_enter(void *context) {
const char *help_msg = "Logs saved.\n\n";
furi_string_cat_str(app->text_box_store, help_msg);
app->text_box_store_strlen += strlen(help_msg);
write_logs(app->portal_logs);
if(strlen(app->portal_logs) > 0) {
write_logs(app->portal_logs);
free(app->portal_logs);
}
if (app->show_stopscan_tip) {
const char *msg = "Press BACK to return\n";
furi_string_cat_str(app->text_box_store, msg);
Expand Down

0 comments on commit 8e2487b

Please sign in to comment.