summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-08-12 10:19:44 -0400
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-08-12 10:19:44 -0400
commita44da3c14dc81a60159dbb738a4a8e776a821dee (patch)
tree7272d0720c23d5c4b3d9bed711c371af87befe1a
parent72bf84411071b7d949f4670e40587743477d44ae (diff)
ips_layer: Delimit parsed hex value string
Delimits the hex value string on spaces, slashes, carriage returns or newlines, allowing for comments to be added in-line.
-rw-r--r--src/core/file_sys/ips_layer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp
index 4b35ca82f..a33dbe94b 100644
--- a/src/core/file_sys/ips_layer.cpp
+++ b/src/core/file_sys/ips_layer.cpp
@@ -287,7 +287,8 @@ void IPSwitchCompiler::Parse() {
std::copy(value.begin(), value.end(), std::back_inserter(replace));
} else {
// hex replacement
- const auto value = patch_line.substr(9);
+ const auto value =
+ patch_line.substr(9, patch_line.find_first_of(" /\r\n", 9) - 9);
replace = Common::HexStringToVector(value, is_little_endian);
}