mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-22 13:32:36 +01:00
Don't include null terminator in pattern string_view
This commit is contained in:
parent
ace01292eb
commit
fa1d50b62c
@ -223,7 +223,7 @@ void pattern::EnsureMatches(uint32_t maxCount)
|
||||
}
|
||||
i++;
|
||||
}
|
||||
else i += std::max(1, j - Last[ ptr[j] ]);
|
||||
else i += std::max(ptrdiff_t(1), j - Last[ ptr[j] ]);
|
||||
}
|
||||
|
||||
m_matched = true;
|
||||
|
@ -117,7 +117,7 @@ namespace hook
|
||||
pattern(const char (&pattern)[Len])
|
||||
: pattern(getRVA<void>(0))
|
||||
{
|
||||
Initialize(pattern, Len);
|
||||
Initialize(pattern, Len-1);
|
||||
}
|
||||
|
||||
inline pattern& count(uint32_t expected) &
|
||||
@ -203,7 +203,7 @@ namespace hook
|
||||
module_pattern(void* module, const char(&pattern)[Len])
|
||||
: pattern(module)
|
||||
{
|
||||
Initialize(pattern, Len);
|
||||
Initialize(pattern, Len-1);
|
||||
}
|
||||
};
|
||||
|
||||
@ -215,7 +215,7 @@ namespace hook
|
||||
range_pattern(uintptr_t begin, uintptr_t end, const char(&pattern)[Len])
|
||||
: pattern(begin, end)
|
||||
{
|
||||
Initialize(pattern, Len);
|
||||
Initialize(pattern, Len-1);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user