From 9a69017752deba7a21861814cbe5f4d0a3467184 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 6 Feb 2013 17:13:14 -0800 Subject: [PATCH] Don't drop the last two chaacters in inline_string_decode --- aegisub/src/string_codec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aegisub/src/string_codec.cpp b/aegisub/src/string_codec.cpp index 7aeb585ef..3b03328ab 100644 --- a/aegisub/src/string_codec.cpp +++ b/aegisub/src/string_codec.cpp @@ -57,8 +57,8 @@ std::string inline_string_encode(const std::string &input) { std::string inline_string_decode(const std::string &input) { std::string output; output.reserve(input.size()); - for (size_t i = 0; i < input.size() - 2; ++i) { - if (input[i] != '#') + for (size_t i = 0; i < input.size(); ++i) { + if (input[i] != '#' || i + 2 < input.size()) output += input[i]; else { output += (char)strtol(input.substr(i + 1, 2).c_str(), nullptr, 16);