Przeglądaj źródła

Update emulation.c

- Removes the file extension from the emulation screen
acegoal07 1 rok temu
rodzic
commit
4d6aeeb00d
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      scences/emulation.c

+ 4 - 1
scences/emulation.c

@@ -90,7 +90,10 @@ int32_t nfc_playlist_emulation_task(void* context) {
 
             if (EmulationState != NfcPlaylistEmulationState_Emulating) {break;}
 
-            char* file_name = strchr(file_path, '/') != NULL ? &strrchr(file_path, '/')[1] : file_path;
+            char const* full_file_name = strchr(file_path, '/') != NULL ? &strrchr(file_path, '/')[1] : file_path;
+            char file_name[sizeof(full_file_name)];
+            strcpy(file_name, full_file_name);
+            strtok(file_name, ".");
             char const* file_ext = &strrchr(file_path, '.')[1];
             int time_counter_ms = (options_emulate_timeout[nfc_playlist->emulate_timeout]*1000);