From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/llxml/llxmlparser.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'linden/indra/llxml/llxmlparser.cpp') diff --git a/linden/indra/llxml/llxmlparser.cpp b/linden/indra/llxml/llxmlparser.cpp index 57e6a30..056d850 100644 --- a/linden/indra/llxml/llxmlparser.cpp +++ b/linden/indra/llxml/llxmlparser.cpp @@ -41,7 +41,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); @@ -73,10 +73,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 @@ -90,7 +90,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; } @@ -98,14 +98,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; } -- cgit v1.1