From 0e118ae170ec7e796f751c5e3356acda7cdb689e Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Fri, 15 Feb 2019 13:54:37 -0600 Subject: [PATCH] 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 --- src/LibHac/IO/RomFs/RomFsDictionary.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LibHac/IO/RomFs/RomFsDictionary.cs b/src/LibHac/IO/RomFs/RomFsDictionary.cs index fd64c93c..9c6a3cfd 100644 --- a/src/LibHac/IO/RomFs/RomFsDictionary.cs +++ b/src/LibHac/IO/RomFs/RomFsDictionary.cs @@ -49,7 +49,7 @@ namespace LibHac.IO.RomFs public bool TryGetValue(int offset, out RomKeyValuePair value) { - if (offset < 0 || offset + _sizeOfEntry >= Entries.Length) + if (offset < 0 || offset + _sizeOfEntry > Entries.Length) { value = default; return false;