Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Generic / String / String.cpp
diff options
context:
space:
mode:
1 files changed, 2 insertions, 1 deletions
-rw-r--r--src/Generic/String/String.cpp3
diff --git a/src/Generic/String/String.cpp b/src/Generic/String/String.cpp
index 96a2ca9..936c647 100644
--- a/src/Generic/String/String.cpp
+++ b/src/Generic/String/String.cpp
@@ -17,7 +17,8 @@ void String::copyFrom(const String& other) {
String::String(unsigned length) {
this->length = length;
- str = new char[length];
+ str = new char[length + 1];
+ str[length] = '\0';
}
String::String(const char* str) {