diff options
Diffstat (limited to 'hscript/script.cc')
-rw-r--r-- | hscript/script.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hscript/script.cc b/hscript/script.cc index 8eb7c18..585a18c 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -219,7 +219,7 @@ const Script *Script::load(std::istream &sstream, const ScriptOptions opts) { key_end = line.find_first_of(delim, start); value_begin = line.find_first_not_of(delim, key_end); - key = line.substr(start, key_end); + key = line.substr(start, (key_end - start)); if(key_end == std::string::npos || value_begin == std::string::npos) { /* Key without value */ PARSER_ERROR("key '" + key + "' has no value") |