From 7cd3341504c0ea7c9391958a3f100f14f5305773 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 21 Aug 2013 21:47:12 +0000 Subject: [PATCH] base: allow String::C() to be non-const. --- src/lol/base/string.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lol/base/string.h b/src/lol/base/string.h index 3762af5b..765339d4 100644 --- a/src/lol/base/string.h +++ b/src/lol/base/string.h @@ -101,6 +101,12 @@ public: return &(*this)[0]; } + /* Non-const version; make sure to not overflow the internal array */ + inline char *C() + { + return &(*this)[0]; + } + /* Does not initialise the newly allocated characters */ void Resize(int count) {