mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2025-02-09 13:14:46 +01:00
Fix RomFsDictionary off-by-one error
When retrieving an entry that happened to be the last entry in the table, the dictionary would incorrectly say that the lookup failed. Fixes #32
This commit is contained in:
parent
46682cd4dd
commit
0e118ae170
@ -49,7 +49,7 @@ namespace LibHac.IO.RomFs
|
|||||||
|
|
||||||
public bool TryGetValue(int offset, out RomKeyValuePair<T> value)
|
public bool TryGetValue(int offset, out RomKeyValuePair<T> value)
|
||||||
{
|
{
|
||||||
if (offset < 0 || offset + _sizeOfEntry >= Entries.Length)
|
if (offset < 0 || offset + _sizeOfEntry > Entries.Length)
|
||||||
{
|
{
|
||||||
value = default;
|
value = default;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user