diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-14 12:51:57 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-14 12:51:57 -0500 |
commit | 3c151b8fc928bc28a190f4a2e58d04981dc509e3 (patch) | |
tree | 17ea082a4038866cfc398a974b3f7c3f7be22e40 | |
parent | 88378c535e0191dd6c8a03759f333f39550fc983 (diff) | |
download | horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.tar.gz horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.tar.bz2 horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.tar.xz horizon-3c151b8fc928bc28a190f4a2e58d04981dc509e3.zip |
hscript: Don't include space when read Mount options
-rw-r--r-- | hscript/disk.cc | 4 |
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")) { |