|
|
@@ -131,15 +131,19 @@ void wifi_marauder_scene_console_output_on_enter(void* context) {
|
|
|
// Create files *before* sending command
|
|
|
// (it takes time to iterate through the directory)
|
|
|
if(app->ok_to_save_logs) {
|
|
|
- strcpy(
|
|
|
- app->log_file_path,
|
|
|
- sequential_file_resolve_path(
|
|
|
- app->storage, MARAUDER_APP_FOLDER_LOGS, prefix, "log"));
|
|
|
- if(storage_file_open(
|
|
|
- app->log_file, app->log_file_path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
|
|
|
- app->is_writing_log = true;
|
|
|
+ char* resolved_path = sequential_file_resolve_path(
|
|
|
+ app->storage, MARAUDER_APP_FOLDER_LOGS, prefix, "log");
|
|
|
+ if(resolved_path != NULL) {
|
|
|
+ strcpy(app->log_file_path, resolved_path);
|
|
|
+ free(resolved_path);
|
|
|
+ if(storage_file_open(
|
|
|
+ app->log_file, app->log_file_path, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
|
|
|
+ app->is_writing_log = true;
|
|
|
+ } else {
|
|
|
+ dialog_message_show_storage_error(app->dialogs, "Cannot open log file");
|
|
|
+ }
|
|
|
} else {
|
|
|
- dialog_message_show_storage_error(app->dialogs, "Cannot open log file");
|
|
|
+ dialog_message_show_storage_error(app->dialogs, "Cannot resolve log path");
|
|
|
}
|
|
|
}
|
|
|
|