summaryrefslogtreecommitdiff
path: root/indra/llxml
diff options
context:
space:
mode:
authorAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
committerAaron Brashears <aaronb@lindenlab.com>2007-02-02 17:28:58 +0000
commit305c74d5163c5e344a675d39ca2394a9e45bd2c2 (patch)
tree42836c4a6010b2b015156024d3cfb6bf64a48ad6 /indra/llxml
parent54d89549df38bb61881583a3eb8d3645c107d79f (diff)
Result of svn merge -r57264:57370 svn+ssh://svn/svn/linden/branches/adroit.r40-68 into release.
Diffstat (limited to 'indra/llxml')
-rw-r--r--indra/llxml/llcontrol.cpp10
-rw-r--r--indra/llxml/llxmlnode.cpp30
-rw-r--r--indra/llxml/llxmlparser.cpp12
-rw-r--r--indra/llxml/llxmlparser.h2
4 files changed, 27 insertions, 27 deletions
diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index a9651fafc7..da6302b27c 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -580,7 +580,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
llifstream file;
S32 version;
- file.open(filename.c_str());
+ file.open(filename.c_str()); /*Flawfinder: ignore*/
if (!file)
{
@@ -610,7 +610,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
if (name.substr(0,2) == "//")
{
// This is a comment.
- char buffer[MAX_STRING];
+ char buffer[MAX_STRING]; /*Flawfinder: ignore*/
file.getline(buffer, MAX_STRING);
continue;
}
@@ -624,7 +624,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
if (!name.empty())
{
//read in to end of line
- char buffer[MAX_STRING];
+ char buffer[MAX_STRING]; /*Flawfinder: ignore*/
file.getline(buffer, MAX_STRING);
llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl;
}
@@ -690,7 +690,7 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de
break;
case TYPE_BOOLEAN:
{
- char boolstring[256];
+ char boolstring[256]; /*Flawfinder: ignore*/
BOOL valid = FALSE;
BOOL initial = FALSE;
@@ -1048,7 +1048,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only)
}
llofstream file;
- file.open(filename.c_str());
+ file.open(filename.c_str()); /*Flawfinder: ignore*/
if (!file.is_open())
{
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index 7d77fa8be7..0789ec6842 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -542,7 +542,7 @@ bool LLXMLNode::parseFile(
LLXMLNode* defaults_tree)
{
// Read file
- FILE* fp = LLFile::fopen(filename.c_str(), "rb");
+ FILE* fp = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */
if (fp == NULL)
{
node = new LLXMLNode();
@@ -1846,12 +1846,12 @@ U32 LLXMLNode::getUUIDValue(U32 expected_length, LLUUID *array)
LLUUID uuid_value;
value_string = skipWhitespace(value_string);
- if (strlen(value_string) < (UUID_STR_LENGTH-1))
+ if (strlen(value_string) < (UUID_STR_LENGTH-1)) /* Flawfinder: ignore */
{
break;
}
- char uuid_string[UUID_STR_LENGTH];
- memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1));
+ char uuid_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
+ memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); /* Flawfinder: ignore */
uuid_string[(UUID_STR_LENGTH-1)] = 0;
if (!LLUUID::parseUUID(uuid_string, &uuid_value))
@@ -2136,18 +2136,18 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
LLString new_value;
if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
{
- char format_string[10];
+ char format_string[10]; /* Flawfinder: ignore */
if (precision > 0)
{
if (precision > 25)
{
precision = 25;
}
- sprintf(format_string, "%%.%dg", precision);
+ snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
}
else
{
- sprintf(format_string, "%%g");
+ snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
}
for (U32 pos=0; pos<length; ++pos)
@@ -2187,18 +2187,18 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
LLString new_value;
if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
{
- char format_string[10];
+ char format_string[10]; /* Flawfinder: ignore */
if (precision > 0)
{
if (precision > 25)
{
precision = 25;
}
- sprintf(format_string, "%%.%dg", precision);
+ snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
}
else
{
- sprintf(format_string, "%%g");
+ snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
}
for (U32 pos=0; pos<length; ++pos)
{
@@ -2472,7 +2472,7 @@ LLXMLNode *get_rand_node(LLXMLNode *node)
void LLXMLNode::createUnitTest(S32 max_num_children)
{
// Random ID
- char rand_id[20];
+ char rand_id[20]; /* Flawfinder: ignore */
U32 rand_id_len = get_rand(10)+5;
U32 pos = 0;
for (; pos<rand_id_len; ++pos)
@@ -2501,7 +2501,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
for (U32 child_num=0; child_num<num_children; ++child_num)
{
// Random Name
- char child_name[20];
+ char child_name[20]; /* Flawfinder: ignore */
U32 child_name_len = get_rand(10)+5;
pos = 0;
for (; pos<child_name_len; ++pos)
@@ -2513,7 +2513,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
LLXMLNode *new_child = createChild(child_name, FALSE);
// Random ID
- char child_id[20];
+ char child_id[20]; /* Flawfinder: ignore */
U32 child_id_len = get_rand(10)+5;
pos = 0;
for (; pos<child_id_len; ++pos)
@@ -2634,7 +2634,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
{
random_node_array[value] = get_rand_node(root);
const char *node_name = random_node_array[value]->mName->mString;
- for (U32 pos=0; pos<strlen(node_name); ++pos)
+ for (U32 pos=0; pos<strlen(node_name); ++pos) /* Flawfinder: ignore */
{
U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8);
noderef_checksum ^= hash_contrib;
@@ -2806,7 +2806,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
for (U32 pos=0; pos<node->mLength; ++pos)
{
const char *node_name = node_array[pos]->mName->mString;
- for (U32 pos2=0; pos2<strlen(node_name); ++pos2)
+ for (U32 pos2=0; pos2<strlen(node_name); ++pos2) /* Flawfinder: ignore */
{
U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8);
noderef_checksum ^= hash_contrib;
diff --git a/indra/llxml/llxmlparser.cpp b/indra/llxml/llxmlparser.cpp
index baaeedf586..c3d791179a 100644
--- a/indra/llxml/llxmlparser.cpp
+++ b/indra/llxml/llxmlparser.cpp
@@ -22,7 +22,7 @@ LLXmlParser::LLXmlParser()
mParser( NULL ),
mDepth( 0 )
{
- strcpy( mAuxErrorString, "no error" );
+ strcpy( mAuxErrorString, "no error" ); /* Flawfinder: ignore */
// Override the document's declared encoding.
mParser = XML_ParserCreate(NULL);
@@ -54,10 +54,10 @@ BOOL LLXmlParser::parseFile(const std::string &path)
BOOL success = TRUE;
- FILE *file = LLFile::fopen(path.c_str(), "rb");
+ FILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */
if( !file )
{
- sprintf( mAuxErrorString, "Couldn't open file %s", path.c_str());
+ snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */
success = FALSE;
}
else
@@ -71,7 +71,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
void* buffer = XML_GetBuffer(mParser, buffer_size);
if( !buffer )
{
- sprintf( mAuxErrorString, "Unable to allocate XML buffer while reading file %s", path.c_str() );
+ snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */
success = FALSE;
goto exit_label;
}
@@ -79,14 +79,14 @@ BOOL LLXmlParser::parseFile(const std::string &path)
bytes_read = (S32)fread(buffer, 1, buffer_size, file);
if( bytes_read <= 0 )
{
- sprintf( mAuxErrorString, "Error while reading file %s", path.c_str() );
+ snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */
success = FALSE;
goto exit_label;
}
if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
{
- sprintf( mAuxErrorString, "Error while parsing file %s", path.c_str() );
+ snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */
success = FALSE;
}
diff --git a/indra/llxml/llxmlparser.h b/indra/llxml/llxmlparser.h
index 2cb75591fb..2ef790094e 100644
--- a/indra/llxml/llxmlparser.h
+++ b/indra/llxml/llxmlparser.h
@@ -103,7 +103,7 @@ public:
protected:
XML_Parser mParser;
int mDepth;
- char mAuxErrorString[1024];
+ char mAuxErrorString[1024]; /*Flawfinder: ignore*/
};
#endif // LL_LLXMLPARSER_H