Skip to content

Commit 01d2c97

Browse files
committed
fixed solosky#193: fixed crash when enter card emulator app
1 parent 4dc1837 commit 01d2c97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fw/application/src/app/chameleon/port/fds_utils.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ static void fds_map_file_name(uint16_t id, uint16_t key, char *path) {
2222
}
2323
}
2424

25-
bool fds_read_sync(uint16_t id, uint16_t key, uint16_t max_length, uint8_t *buffer) {
25+
bool fds_read_sync(uint16_t id, uint16_t key, uint16_t* max_length, uint8_t *buffer) {
2626
char path[VFS_MAX_PATH_LEN];
2727
fds_map_file_name(id, key, path);
28-
int32_t bytes_read = vfs_get_default_driver()->read_file_data(path, buffer, max_length);
28+
int32_t bytes_read = vfs_get_default_driver()->read_file_data(path, buffer, *max_length);
29+
*max_length = bytes_read;
2930
NRF_LOG_INFO("fds_read_sync: id=%X, key=%d, bytes_read=%d", id, key, bytes_read);
3031
return bytes_read > 0;
3132
}

0 commit comments

Comments
 (0)