--- lbbs/src/screen.c 2025/06/10 06:47:04 1.91 +++ lbbs/src/screen.c 2025/06/11 10:44:33 1.92 @@ -427,26 +427,26 @@ int display_data(const void *p_data, lon break; case KEY_F2: // For test only EDITOR_DATA *p_editor_data; - // size_t data_new_len = strlen(p_data) + LINE_BUFFER_LEN; + size_t data_new_len = strlen(p_data) + LINE_BUFFER_LEN; - // char *p_data_new = malloc(data_new_len); - // if (p_data_new == NULL) - // { - // break; - // } + char *p_data_new = malloc(data_new_len); + if (p_data_new == NULL) + { + break; + } p_editor_data = editor_data_load(p_data); if (p_editor_data == NULL) { - // free(p_data_new); + free(p_data_new); break; } editor_display(p_editor_data); - // editor_data_save(p_editor_data, p_data_new, data_new_len); + editor_data_save(p_editor_data, p_data_new, data_new_len); editor_data_cleanup(p_editor_data); p_editor_data = NULL; - // free(p_data_new); - // p_data_new = NULL; + free(p_data_new); + p_data_new = NULL; // Refresh after display editor line_current -= (screen_current_row - screen_begin_row);