patterns: Fixed null bytes being included in read strings

This commit is contained in:
WerWolv 2021-10-07 21:47:39 +02:00
parent 241bbd80bc
commit 7498a72f70
1 changed files with 2 additions and 0 deletions

View File

@ -1421,6 +1421,7 @@ namespace hex::pl {
else { else {
value.resize(pattern->getSize()); value.resize(pattern->getSize());
evaluator->getProvider()->read(pattern->getOffset(), value.data(), value.size()); evaluator->getProvider()->read(pattern->getOffset(), value.data(), value.size());
value.erase(std::find(value.begin(), value.end(), '\0'), value.end());
} }
}; };
@ -1476,6 +1477,7 @@ namespace hex::pl {
else { else {
value.resize(pattern->getSize()); value.resize(pattern->getSize());
evaluator->getProvider()->read(pattern->getOffset(), value.data(), value.size()); evaluator->getProvider()->read(pattern->getOffset(), value.data(), value.size());
value.erase(std::find(value.begin(), value.end(), '\0'), value.end());
} }
literal = value; literal = value;