summaryrefslogtreecommitdiff
path: root/hscript/disk.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-14 12:51:57 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-14 12:51:57 -0500
commit3c151b8fc928bc28a190f4a2e58d04981dc509e3 (patch)
tree17ea082a4038866cfc398a974b3f7c3f7be22e40 /hscript/disk.cc
parent88378c535e0191dd6c8a03759f333f39550fc983 (diff)
downloadhorizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.tar.gz
horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.tar.bz2
horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.tar.xz
horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.zip
hscript: Don't include space when read Mount options
Diffstat (limited to 'hscript/disk.cc')
-rw-r--r--hscript/disk.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc
index 5303ccc..8720b0b 100644
--- a/hscript/disk.cc
+++ b/hscript/disk.cc
@@ -39,8 +39,8 @@ Key *Mount::parseFromData(const std::string &data, int lineno, int *errors,
dev = data.substr(0, where_pos);
where = data.substr(where_pos + 1, (opt_pos - where_pos - 1));
- if(opt_pos != std::string::npos) {
- opt = data.substr(opt_pos);
+ if(opt_pos != std::string::npos && data.length() > opt_pos + 1) {
+ opt = data.substr(opt_pos + 1);
}
if(dev.compare(0, 4, "/dev")) {