summaryrefslogtreecommitdiff
path: root/indra/newview/lluploaddialog.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
committerAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
commitb01c75cb423f07a3d3354f8bd62f265f80062b3b (patch)
treedec1b220c24a60cc220d1cb07fd3545610644f0a /indra/newview/lluploaddialog.cpp
parent868250bdd74f348557102c0d8408d9bec30331f6 (diff)
svn merge -r117314:117337
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1 QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
Diffstat (limited to 'indra/newview/lluploaddialog.cpp')
-rw-r--r--indra/newview/lluploaddialog.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp
index 2ba87f01bd..7f63972c8d 100644
--- a/indra/newview/lluploaddialog.cpp
+++ b/indra/newview/lluploaddialog.cpp
@@ -103,18 +103,10 @@ void LLUploadDialog::setMessage( const std::string& msg)
S32 max_msg_width = 0;
std::list<std::string> msg_lines;
- S32 size = msg.size() + 1;// + strlen("Uploading...\n\n");
- char* temp_msg = new char[size];
-
- //strcpy(temp_msg,"Uploading...\n\n");
- if (temp_msg == NULL)
- {
- llerrs << "Memory Allocation Failed" << llendl;
- return;
- }
-
- strcpy( temp_msg, msg.c_str()); /* Flawfinder: ignore */
- char* token = strtok( temp_msg, "\n" );
+ S32 size = msg.size() + 1;
+ std::vector<char> temp_msg(size); // non-const copy to make strtok happy
+ strcpy( &temp_msg[0], msg.c_str());
+ char* token = strtok( &temp_msg[0], "\n" );
while( token )
{
std::string tokstr(token);
@@ -123,8 +115,6 @@ void LLUploadDialog::setMessage( const std::string& msg)
msg_lines.push_back( tokstr );
token = strtok( NULL, "\n" );
}
- delete[] temp_msg;
-
S32 line_height = S32( font->getLineHeight() + 0.99f );
S32 dialog_width = max_msg_width + 2 * HPAD;