summaryrefslogtreecommitdiff
path: root/indra/llui/llclipboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llclipboard.cpp')
-rw-r--r--indra/llui/llclipboard.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 64896ccfcb..0483da001f 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -132,6 +132,11 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us
LL_WARNS() << "Can't add the substring to clipboard: " << e.what() << LL_ENDL;
return false;
}
+
+ // Clipboards cannot contain NULL characters, so remove them first so they
+ // do not truncate the string.
+ mString.erase(std::remove(mString.begin(), mString.end(), 0), mString.end());
+
return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString));
}