summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstring.h
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2009-10-16 16:42:45 -0700
commit3e10fa4d51a23bf6f1ced23e8d90c636d84fa5db (patch)
treed4991e4c1a9dd934f48d33804e55eb8ffa085679 /indra/llcommon/llstring.h
parente9f7205ba9f4dfb3422759218609b62d61972722 (diff)
parentf20e9521a9b70f4e83cbb6888feae08a70681ea7 (diff)
merge from latest svn/viewer-2-0 to hg/viewer-2-0
Diffstat (limited to 'indra/llcommon/llstring.h')
-rw-r--r--indra/llcommon/llstring.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index d280c51226..0f2f05a0d8 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -34,6 +34,7 @@
#define LL_LLSTRING_H
#include <string>
+#include <cstdio>
#include <locale>
#include <iomanip>
#include "llsd.h"
@@ -998,14 +999,15 @@ void LLStringUtilBase<T>::stripNonprintable(std::basic_string<T>& string)
{
return;
}
- char* c_string = new char[string.size() + 1];
+ size_t src_size = string.size();
+ char* c_string = new char[src_size + 1];
if(c_string == NULL)
{
return;
}
- strcpy(c_string, string.c_str()); /*Flawfinder: ignore*/
+ copy(c_string, string.c_str(), src_size+1);
char* write_head = &c_string[0];
- for (size_type i = 0; i < string.size(); i++)
+ for (size_type i = 0; i < src_size; i++)
{
char* read_head = &string[i];
write_head = &c_string[j];