summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-08 14:08:15 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-08 14:08:15 +0100
commit48d48679b0475d525db9bc644acd3157d4117f69 (patch)
tree936fe6703aa06ebeaf98adbe0344a7309edf9821 /AK
parentb8581b0069ba8591013f00a08e6ba8ee8a0588e2 (diff)
downloadserenity-48d48679b0475d525db9bc644acd3157d4117f69.zip
GTextEditor: Work on cut/copy/paste operations.
Diffstat (limited to 'AK')
-rw-r--r--AK/String.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/AK/String.cpp b/AK/String.cpp
index 8fd8e2fec2..4c3e2692ac 100644
--- a/AK/String.cpp
+++ b/AK/String.cpp
@@ -38,6 +38,8 @@ String String::isolated_copy() const
String String::substring(ssize_t start, ssize_t length) const
{
+ if (!length)
+ return empty();
ASSERT(m_impl);
ASSERT(start + length <= m_impl->length());
// FIXME: This needs some input bounds checking.