Skip to content

Commit

Permalink
Update emulation.c
Browse files Browse the repository at this point in the history
  • Loading branch information
acegoal07 committed Jan 18, 2024
1 parent 28c4893 commit 9699914
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scences/emulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ int32_t nfc_playlist_emulation_task(void* context) {
int time_counter_ms = (options_emulate_timeout[nfc_playlist->emulate_timeout]*1000);

if (storage_file_exists(storage, file_path) == false) {
char popup_header_text[(18 + strlen(file_name))];
snprintf(popup_header_text, (18 + strlen(file_name)), "%s\n%s", "ERROR not found:", file_name);
int popup_header_text_size = strlen(file_name) + 18;
char popup_header_text[popup_header_text_size];
snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "ERROR not found:", file_name);
popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
start_blink(nfc_playlist, NfcPlaylistLedState_Error);
while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
Expand All @@ -109,8 +110,9 @@ int32_t nfc_playlist_emulation_task(void* context) {
}

else if (strcasestr(file_ext, "nfc") == NULL) {
char popup_header_text[(21 + strlen(file_name))];
snprintf(popup_header_text, (21 + strlen(file_name)), "%s\n%s", "ERROR invalid file:", file_name);
int popup_header_text_size = strlen(file_name) + 21;
char popup_header_text[popup_header_text_size];
snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "ERROR invalid file:", file_name);
popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
start_blink(nfc_playlist, NfcPlaylistLedState_Error);
while(time_counter_ms > 0 && EmulationState == NfcPlaylistEmulationState_Emulating) {
Expand All @@ -123,8 +125,9 @@ int32_t nfc_playlist_emulation_task(void* context) {
}

else {
char popup_header_text[(12 + strlen(file_name))];
snprintf(popup_header_text, (12 + strlen(file_name)), "%s\n%s", "Emulating:", file_name);
int popup_header_text_size = strlen(file_name) + 12;
char popup_header_text[popup_header_text_size];
snprintf(popup_header_text, popup_header_text_size, "%s\n%s", "Emulating:", file_name);
popup_set_header(nfc_playlist->popup, popup_header_text, 64, 10, AlignCenter, AlignTop);
nfc_playlist_worker_set_nfc_data(nfc_playlist->nfc_playlist_worker, file_path);
nfc_playlist_worker_start(nfc_playlist->nfc_playlist_worker);
Expand Down

0 comments on commit 9699914

Please sign in to comment.