summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/mmo.hpp2
-rw-r--r--src/common/strings.hpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/common/mmo.hpp b/src/common/mmo.hpp
index 89ff50a..0d3403c 100644
--- a/src/common/mmo.hpp
+++ b/src/common/mmo.hpp
@@ -65,7 +65,7 @@ public:
MapName(VString<15> v) : _impl(v.oislice_h(std::find(v.begin(), v.end(), '.'))) {}
iterator begin() const { return &*_impl.begin(); }
- iterator end() const { return &*_impl.begin(); }
+ iterator end() const { return &*_impl.end(); }
const char *c_str() const { return _impl.c_str(); }
operator FString() const { return _impl; }
diff --git a/src/common/strings.hpp b/src/common/strings.hpp
index ead3f52..0b10570 100644
--- a/src/common/strings.hpp
+++ b/src/common/strings.hpp
@@ -119,6 +119,10 @@ namespace strings
operator bool() const { return size(); }
bool operator !() const { return !size(); }
+ // the existence of this has led to bugs
+ // it's not really sane from a unicode perspective anyway ...
+ // prefer startswith or extract
+ __attribute__((deprecated))
char operator[](size_t i) const { return begin()[i]; }
char front() const { return *begin(); }
char back() const { return end()[-1]; }