mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-20 03:24:51 +00:00
ams_mitm: fix logic error when truncating pairing database on read
This commit is contained in:
parent
74f551f090
commit
906ba502c9
1 changed files with 3 additions and 3 deletions
|
@ -114,11 +114,11 @@ namespace ams::mitm::settings {
|
|||
|
||||
u64 db_offset = sizeof(total_entries);
|
||||
if (total_entries > db_max_size) {
|
||||
/* Cap number of database entries read to size of database on this firmware. */
|
||||
total_entries = db_max_size;
|
||||
|
||||
/* Pairings are stored from least to most recent. Add offset to skip the older entries that won't fit. */
|
||||
db_offset += (total_entries - db_max_size) * sizeof(settings::BluetoothDevicesSettings);
|
||||
|
||||
/* Cap number of database entries read to size of database on this firmware. */
|
||||
total_entries = db_max_size;
|
||||
}
|
||||
|
||||
/* Read database entries. */
|
||||
|
|
Loading…
Add table
Reference in a new issue