aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml/llxmlparser.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llxml/llxmlparser.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llxml/llxmlparser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/linden/indra/llxml/llxmlparser.cpp b/linden/indra/llxml/llxmlparser.cpp
index 3b4d944..b0a3a05 100644
--- a/linden/indra/llxml/llxmlparser.cpp
+++ b/linden/indra/llxml/llxmlparser.cpp
@@ -45,7 +45,7 @@ LLXmlParser::LLXmlParser()
45 mParser( NULL ), 45 mParser( NULL ),
46 mDepth( 0 ) 46 mDepth( 0 )
47{ 47{
48 strcpy( mAuxErrorString, "no error" ); /* Flawfinder: ignore */ 48 mAuxErrorString = "no error";
49 49
50 // Override the document's declared encoding. 50 // Override the document's declared encoding.
51 mParser = XML_ParserCreate(NULL); 51 mParser = XML_ParserCreate(NULL);
@@ -77,10 +77,10 @@ BOOL LLXmlParser::parseFile(const std::string &path)
77 77
78 BOOL success = TRUE; 78 BOOL success = TRUE;
79 79
80 LLFILE* file = LLFile::fopen(path.c_str(), "rb"); /* Flawfinder: ignore */ 80 LLFILE* file = LLFile::fopen(path, "rb"); /* Flawfinder: ignore */
81 if( !file ) 81 if( !file )
82 { 82 {
83 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Couldn't open file %s", path.c_str()); /* Flawfinder: ignore */ 83 mAuxErrorString = llformat( "Couldn't open file %s", path.c_str());
84 success = FALSE; 84 success = FALSE;
85 } 85 }
86 else 86 else
@@ -94,7 +94,7 @@ BOOL LLXmlParser::parseFile(const std::string &path)
94 void* buffer = XML_GetBuffer(mParser, buffer_size); 94 void* buffer = XML_GetBuffer(mParser, buffer_size);
95 if( !buffer ) 95 if( !buffer )
96 { 96 {
97 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Unable to allocate XML buffer while reading file %s", path.c_str() ); /* Flawfinder: ignore */ 97 mAuxErrorString = llformat( "Unable to allocate XML buffer while reading file %s", path.c_str() );
98 success = FALSE; 98 success = FALSE;
99 goto exit_label; 99 goto exit_label;
100 } 100 }
@@ -102,14 +102,14 @@ BOOL LLXmlParser::parseFile(const std::string &path)
102 bytes_read = (S32)fread(buffer, 1, buffer_size, file); 102 bytes_read = (S32)fread(buffer, 1, buffer_size, file);
103 if( bytes_read <= 0 ) 103 if( bytes_read <= 0 )
104 { 104 {
105 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while reading file %s", path.c_str() ); /* Flawfinder: ignore */ 105 mAuxErrorString = llformat( "Error while reading file %s", path.c_str() );
106 success = FALSE; 106 success = FALSE;
107 goto exit_label; 107 goto exit_label;
108 } 108 }
109 109
110 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) ) 110 if( !XML_ParseBuffer(mParser, bytes_read, TRUE ) )
111 { 111 {
112 snprintf( mAuxErrorString, sizeof(mAuxErrorString), "Error while parsing file %s", path.c_str() ); /* Flawfinder: ignore */ 112 mAuxErrorString = llformat( "Error while parsing file %s", path.c_str() );
113 success = FALSE; 113 success = FALSE;
114 } 114 }
115 115
@@ -146,7 +146,7 @@ const char* LLXmlParser::getErrorString()
146 const char* error_string = XML_ErrorString(XML_GetErrorCode( mParser )); 146 const char* error_string = XML_ErrorString(XML_GetErrorCode( mParser ));
147 if( !error_string ) 147 if( !error_string )
148 { 148 {
149 error_string = mAuxErrorString; 149 error_string = mAuxErrorString.c_str();
150 } 150 }
151 return error_string; 151 return error_string;
152} 152}