DEV-41081 - better than using the msvc kludge for suppressing warnings about memcpy, don't actually use memcpy - use our own safe 'copy' method. also stripNonprintable() is probably a little faster now...

meow-7.2.2
Adam Moss 2009-10-08 14:14:13 +00:00
parent bb533f4d11
commit 9665d7a71b
2 changed files with 4 additions and 6 deletions

View File

@ -991,14 +991,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];

View File

@ -32,9 +32,6 @@
* $/LicenseInfo$
*/
// win32 kludge-o-rama
#define _CRT_SECURE_NO_WARNINGS
#include "../test/lltut.h"
#include "../llstring.h"