MX 2 лет назад
Родитель
Сommit
d25c38162c
2 измененных файлов с 2 добавлено и 20 удалено
  1. 2 4
      helpers/evil_portal_storage.c
  2. 0 16
      scenes/evil_portal_scene_select_html.c

+ 2 - 4
helpers/evil_portal_storage.c

@@ -23,7 +23,7 @@ void evil_portal_read_index_html(void* context) {
         File* index_html = storage_file_alloc(storage);
         File* index_html = storage_file_alloc(storage);
         if(storage_file_open(
         if(storage_file_open(
                index_html, EVIL_PORTAL_INDEX_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {
                index_html, EVIL_PORTAL_INDEX_SAVE_PATH, FSAM_READ, FSOM_OPEN_EXISTING)) {
-            app->index_html = malloc((size_t)fi.size);
+            app->index_html = malloc((size_t)fi.size + 1);
             uint8_t* buf_ptr = app->index_html;
             uint8_t* buf_ptr = app->index_html;
             size_t read = 0;
             size_t read = 0;
             while(read < fi.size) {
             while(read < fi.size) {
@@ -33,7 +33,7 @@ void evil_portal_read_index_html(void* context) {
                 read += now_read;
                 read += now_read;
                 buf_ptr += now_read;
                 buf_ptr += now_read;
             }
             }
-            free(buf_ptr);
+            *buf_ptr = '\0';
         }
         }
         storage_file_close(index_html);
         storage_file_close(index_html);
         storage_file_free(index_html);
         storage_file_free(index_html);
@@ -94,8 +94,6 @@ void evil_portal_read_ap_name(void* context) {
                 buf_ptr += now_read;
                 buf_ptr += now_read;
             }
             }
             *buf_ptr = '\0';
             *buf_ptr = '\0';
-            buf_ptr++;
-            free(buf_ptr);
         }
         }
         storage_file_close(ap_name);
         storage_file_close(ap_name);
         storage_file_free(ap_name);
         storage_file_free(ap_name);

+ 0 - 16
scenes/evil_portal_scene_select_html.c

@@ -1,20 +1,6 @@
 #include "../evil_portal_app_i.h"
 #include "../evil_portal_app_i.h"
 #include "../helpers/evil_portal_storage.h"
 #include "../helpers/evil_portal_storage.h"
 
 
-void evil_portal_show_loading_popup(Evil_PortalApp* app, bool show) {
-    ViewStack* view_stack = app->view_stack;
-    Loading* loading = app->loading;
-    if(show) {
-        // Raise timer priority so that animations can play
-        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
-        view_stack_add_view(view_stack, loading_get_view(loading));
-    } else {
-        view_stack_remove_view(view_stack, loading_get_view(loading));
-        // Restore default timer priority
-        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
-    }
-}
-
 void evil_portal_scene_select_html_on_enter(void* context) {
 void evil_portal_scene_select_html_on_enter(void* context) {
     Evil_PortalApp* app = context;
     Evil_PortalApp* app = context;
     DialogsFileBrowserOptions browser_options;
     DialogsFileBrowserOptions browser_options;
@@ -33,9 +19,7 @@ void evil_portal_scene_select_html_on_enter(void* context) {
 
 
     if(success) {
     if(success) {
         //Replace HTML File
         //Replace HTML File
-        evil_portal_show_loading_popup(app, true);
         evil_portal_replace_index_html(app->file_path);
         evil_portal_replace_index_html(app->file_path);
-        evil_portal_show_loading_popup(app, false);
     }
     }
 
 
     scene_manager_search_and_switch_to_previous_scene(app->scene_manager, Evil_PortalSceneStart);
     scene_manager_search_and_switch_to_previous_scene(app->scene_manager, Evil_PortalSceneStart);