mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-31 06:57:28 +05:00
Don't include null terminator in pattern string_view
This commit is contained in:
parent
ace01292eb
commit
fa1d50b62c
2 changed files with 4 additions and 4 deletions
|
@ -223,7 +223,7 @@ void pattern::EnsureMatches(uint32_t maxCount)
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
else i += std::max(1, j - Last[ ptr[j] ]);
|
else i += std::max(ptrdiff_t(1), j - Last[ ptr[j] ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_matched = true;
|
m_matched = true;
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace hook
|
||||||
pattern(const char (&pattern)[Len])
|
pattern(const char (&pattern)[Len])
|
||||||
: pattern(getRVA<void>(0))
|
: pattern(getRVA<void>(0))
|
||||||
{
|
{
|
||||||
Initialize(pattern, Len);
|
Initialize(pattern, Len-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline pattern& count(uint32_t expected) &
|
inline pattern& count(uint32_t expected) &
|
||||||
|
@ -203,7 +203,7 @@ namespace hook
|
||||||
module_pattern(void* module, const char(&pattern)[Len])
|
module_pattern(void* module, const char(&pattern)[Len])
|
||||||
: pattern(module)
|
: 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])
|
range_pattern(uintptr_t begin, uintptr_t end, const char(&pattern)[Len])
|
||||||
: pattern(begin, end)
|
: pattern(begin, end)
|
||||||
{
|
{
|
||||||
Initialize(pattern, Len);
|
Initialize(pattern, Len-1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue