diff --git a/aegisub/src/ass_style.cpp b/aegisub/src/ass_style.cpp index 5db7da635..085107c48 100644 --- a/aegisub/src/ass_style.cpp +++ b/aegisub/src/ass_style.cpp @@ -79,10 +79,10 @@ class parser { std::vector tkns; size_t tkn_idx; - string_range& next_tok() { + string_range next_tok() { if (tkn_idx >= tkns.size()) throw SubtitleFormatParseError("Malformed style: not enough fields", 0); - return tkns[tkn_idx++]; + return trim_copy(tkns[tkn_idx++]); } public: @@ -102,12 +102,12 @@ public: } std::string next_str() { - auto tkn = trim_copy(next_tok()); + auto tkn = next_tok(); return std::string(begin(tkn), end(tkn)); } agi::Color next_color() { - auto &tkn = next_tok(); + auto tkn = next_tok(); return std::string(begin(tkn), end(tkn)); }