aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml/llxmlnode.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llxml/llxmlnode.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/llxml/llxmlnode.cpp')
-rw-r--r--linden/indra/llxml/llxmlnode.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp
index 6366519..50a08be 100644
--- a/linden/indra/llxml/llxmlnode.cpp
+++ b/linden/indra/llxml/llxmlnode.cpp
@@ -561,7 +561,7 @@ bool LLXMLNode::parseFile(
561 LLXMLNode* defaults_tree) 561 LLXMLNode* defaults_tree)
562{ 562{
563 // Read file 563 // Read file
564 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); 564 FILE* fp = LLFile::fopen(filename.c_str(), "rb"); /* Flawfinder: ignore */
565 if (fp == NULL) 565 if (fp == NULL)
566 { 566 {
567 node = new LLXMLNode(); 567 node = new LLXMLNode();
@@ -1865,12 +1865,12 @@ U32 LLXMLNode::getUUIDValue(U32 expected_length, LLUUID *array)
1865 LLUUID uuid_value; 1865 LLUUID uuid_value;
1866 value_string = skipWhitespace(value_string); 1866 value_string = skipWhitespace(value_string);
1867 1867
1868 if (strlen(value_string) < (UUID_STR_LENGTH-1)) 1868 if (strlen(value_string) < (UUID_STR_LENGTH-1)) /* Flawfinder: ignore */
1869 { 1869 {
1870 break; 1870 break;
1871 } 1871 }
1872 char uuid_string[UUID_STR_LENGTH]; 1872 char uuid_string[UUID_STR_LENGTH]; /* Flawfinder: ignore */
1873 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); 1873 memcpy(uuid_string, value_string, (UUID_STR_LENGTH-1)); /* Flawfinder: ignore */
1874 uuid_string[(UUID_STR_LENGTH-1)] = 0; 1874 uuid_string[(UUID_STR_LENGTH-1)] = 0;
1875 1875
1876 if (!LLUUID::parseUUID(uuid_string, &uuid_value)) 1876 if (!LLUUID::parseUUID(uuid_string, &uuid_value))
@@ -2155,18 +2155,18 @@ void LLXMLNode::setFloatValue(U32 length, const F32 *array, Encoding encoding, U
2155 LLString new_value; 2155 LLString new_value;
2156 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2156 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2157 { 2157 {
2158 char format_string[10]; 2158 char format_string[10]; /* Flawfinder: ignore */
2159 if (precision > 0) 2159 if (precision > 0)
2160 { 2160 {
2161 if (precision > 25) 2161 if (precision > 25)
2162 { 2162 {
2163 precision = 25; 2163 precision = 25;
2164 } 2164 }
2165 sprintf(format_string, "%%.%dg", precision); 2165 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
2166 } 2166 }
2167 else 2167 else
2168 { 2168 {
2169 sprintf(format_string, "%%g"); 2169 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
2170 } 2170 }
2171 2171
2172 for (U32 pos=0; pos<length; ++pos) 2172 for (U32 pos=0; pos<length; ++pos)
@@ -2206,18 +2206,18 @@ void LLXMLNode::setDoubleValue(U32 length, const F64 *array, Encoding encoding,
2206 LLString new_value; 2206 LLString new_value;
2207 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL) 2207 if (encoding == ENCODING_DEFAULT || encoding == ENCODING_DECIMAL)
2208 { 2208 {
2209 char format_string[10]; 2209 char format_string[10]; /* Flawfinder: ignore */
2210 if (precision > 0) 2210 if (precision > 0)
2211 { 2211 {
2212 if (precision > 25) 2212 if (precision > 25)
2213 { 2213 {
2214 precision = 25; 2214 precision = 25;
2215 } 2215 }
2216 sprintf(format_string, "%%.%dg", precision); 2216 snprintf(format_string, sizeof(format_string), "%%.%dg", precision); /* Flawfinder: ignore */
2217 } 2217 }
2218 else 2218 else
2219 { 2219 {
2220 sprintf(format_string, "%%g"); 2220 snprintf(format_string, sizeof(format_string), "%%g"); /* Flawfinder: ignore */
2221 } 2221 }
2222 for (U32 pos=0; pos<length; ++pos) 2222 for (U32 pos=0; pos<length; ++pos)
2223 { 2223 {
@@ -2294,7 +2294,7 @@ void LLXMLNode::setUUIDValue(U32 length, const LLUUID *array)
2294 LLString new_value; 2294 LLString new_value;
2295 for (U32 pos=0; pos<length; ++pos) 2295 for (U32 pos=0; pos<length; ++pos)
2296 { 2296 {
2297 new_value.append(array[pos].getString()); 2297 new_value.append(array[pos].asString());
2298 if (pos < length-1) new_value.append(" "); 2298 if (pos < length-1) new_value.append(" ");
2299 } 2299 }
2300 2300
@@ -2491,7 +2491,7 @@ LLXMLNode *get_rand_node(LLXMLNode *node)
2491void LLXMLNode::createUnitTest(S32 max_num_children) 2491void LLXMLNode::createUnitTest(S32 max_num_children)
2492{ 2492{
2493 // Random ID 2493 // Random ID
2494 char rand_id[20]; 2494 char rand_id[20]; /* Flawfinder: ignore */
2495 U32 rand_id_len = get_rand(10)+5; 2495 U32 rand_id_len = get_rand(10)+5;
2496 U32 pos = 0; 2496 U32 pos = 0;
2497 for (; pos<rand_id_len; ++pos) 2497 for (; pos<rand_id_len; ++pos)
@@ -2520,7 +2520,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2520 for (U32 child_num=0; child_num<num_children; ++child_num) 2520 for (U32 child_num=0; child_num<num_children; ++child_num)
2521 { 2521 {
2522 // Random Name 2522 // Random Name
2523 char child_name[20]; 2523 char child_name[20]; /* Flawfinder: ignore */
2524 U32 child_name_len = get_rand(10)+5; 2524 U32 child_name_len = get_rand(10)+5;
2525 pos = 0; 2525 pos = 0;
2526 for (; pos<child_name_len; ++pos) 2526 for (; pos<child_name_len; ++pos)
@@ -2532,7 +2532,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2532 LLXMLNode *new_child = createChild(child_name, FALSE); 2532 LLXMLNode *new_child = createChild(child_name, FALSE);
2533 2533
2534 // Random ID 2534 // Random ID
2535 char child_id[20]; 2535 char child_id[20]; /* Flawfinder: ignore */
2536 U32 child_id_len = get_rand(10)+5; 2536 U32 child_id_len = get_rand(10)+5;
2537 pos = 0; 2537 pos = 0;
2538 for (; pos<child_id_len; ++pos) 2538 for (; pos<child_id_len; ++pos)
@@ -2653,7 +2653,7 @@ void LLXMLNode::createUnitTest(S32 max_num_children)
2653 { 2653 {
2654 random_node_array[value] = get_rand_node(root); 2654 random_node_array[value] = get_rand_node(root);
2655 const char *node_name = random_node_array[value]->mName->mString; 2655 const char *node_name = random_node_array[value]->mName->mString;
2656 for (U32 pos=0; pos<strlen(node_name); ++pos) 2656 for (U32 pos=0; pos<strlen(node_name); ++pos) /* Flawfinder: ignore */
2657 { 2657 {
2658 U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8); 2658 U32 hash_contrib = U32(node_name[pos]) << ((pos % 4) * 8);
2659 noderef_checksum ^= hash_contrib; 2659 noderef_checksum ^= hash_contrib;
@@ -2825,7 +2825,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
2825 for (U32 pos=0; pos<node->mLength; ++pos) 2825 for (U32 pos=0; pos<node->mLength; ++pos)
2826 { 2826 {
2827 const char *node_name = node_array[pos]->mName->mString; 2827 const char *node_name = node_array[pos]->mName->mString;
2828 for (U32 pos2=0; pos2<strlen(node_name); ++pos2) 2828 for (U32 pos2=0; pos2<strlen(node_name); ++pos2) /* Flawfinder: ignore */
2829 { 2829 {
2830 U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8); 2830 U32 hash_contrib = U32(node_name[pos2]) << ((pos2 % 4) * 8);
2831 noderef_checksum ^= hash_contrib; 2831 noderef_checksum ^= hash_contrib;
@@ -2896,7 +2896,7 @@ BOOL LLXMLNode::performUnitTest(LLString &error_buffer)
2896 } 2896 }
2897 if (node_uuid_checksum != uuid_checksum) 2897 if (node_uuid_checksum != uuid_checksum)
2898 { 2898 {
2899 error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.getString().c_str(), uuid_checksum.getString().c_str())); 2899 error_buffer.append(llformat("ERROR Node %s: UUID checksum mismatch: read %s / calc %s.\n", mName->mString, node_uuid_checksum.asString().c_str(), uuid_checksum.asString().c_str()));
2900 return FALSE; 2900 return FALSE;
2901 } 2901 }
2902 } 2902 }