diff options
Diffstat (limited to 'linden/indra/llui/lltexteditor.cpp')
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index b0f8b5a..8f22545 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -3782,7 +3782,7 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) | |||
3782 | // <text without \0> (text may contain ext_char_values) | 3782 | // <text without \0> (text may contain ext_char_values) |
3783 | // }\n | 3783 | // }\n |
3784 | 3784 | ||
3785 | char tbuf[MAX_STRING]; | 3785 | char tbuf[MAX_STRING]; /* Flawfinder: ignore */ |
3786 | 3786 | ||
3787 | S32 version = 0; | 3787 | S32 version = 0; |
3788 | instream.getline(tbuf, MAX_STRING); | 3788 | instream.getline(tbuf, MAX_STRING); |
@@ -3822,11 +3822,16 @@ BOOL LLTextEditor::importBuffer(const LLString& buffer ) | |||
3822 | BOOL success = TRUE; | 3822 | BOOL success = TRUE; |
3823 | 3823 | ||
3824 | char* text = new char[ text_len + 1]; | 3824 | char* text = new char[ text_len + 1]; |
3825 | if (text == NULL) | ||
3826 | { | ||
3827 | llerrs << "Memory allocation failure." << llendl; | ||
3828 | return FALSE; | ||
3829 | } | ||
3825 | instream.get(text, text_len + 1, '\0'); | 3830 | instream.get(text, text_len + 1, '\0'); |
3826 | text[text_len] = '\0'; | 3831 | text[text_len] = '\0'; |
3827 | if( text_len != (S32)strlen(text) ) | 3832 | if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */ |
3828 | { | 3833 | { |
3829 | llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl; | 3834 | llwarns << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << llendl;/* Flawfinder: ignore */ |
3830 | success = FALSE; | 3835 | success = FALSE; |
3831 | } | 3836 | } |
3832 | 3837 | ||
@@ -3948,6 +3953,8 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const | |||
3948 | 3953 | ||
3949 | node->createChild("word_wrap", TRUE)->setBoolValue(mWordWrap); | 3954 | node->createChild("word_wrap", TRUE)->setBoolValue(mWordWrap); |
3950 | 3955 | ||
3956 | node->createChild("hide_scrollbar", TRUE)->setBoolValue(mHideScrollbarForShortDocs); | ||
3957 | |||
3951 | addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor"); | 3958 | addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor"); |
3952 | addColorXML(node, mFgColor, "text_color", "TextFgColor"); | 3959 | addColorXML(node, mFgColor, "text_color", "TextFgColor"); |
3953 | addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor"); | 3960 | addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor"); |