diff --git a/components/compiler/scanner.hpp b/components/compiler/scanner.hpp index c8a528348a..b8d0576772 100644 --- a/components/compiler/scanner.hpp +++ b/components/compiler/scanner.hpp @@ -165,7 +165,8 @@ namespace Compiler std::string data() { - return mData; + // NB: mLength is the number of the last element in the array + return std::string(mData, mLength + 1); } private: