summaryrefslogtreecommitdiff
path: root/hscript
diff options
context:
space:
mode:
Diffstat (limited to 'hscript')
-rw-r--r--hscript/disk.cc2
-rw-r--r--hscript/script.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc
index c0b0de9..217dbcb 100644
--- a/hscript/disk.cc
+++ b/hscript/disk.cc
@@ -38,7 +38,7 @@ Key *Mount::parseFromData(const std::string data, int lineno, int *errors,
opt_pos = data.find_first_of(' ', where_pos);
dev = data.substr(0, where_pos);
- where = data.substr(where_pos + 1, opt_pos);
+ where = data.substr(where_pos + 1, (opt_pos - where_pos - 1));
if(opt_pos != std::string::npos) {
opt = data.substr(opt_pos);
}
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")