aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:04 -0500
committerJacek Antonelli2008-08-15 23:45:04 -0500
commit117e22047c5752352342d64e3fb7ce00a4eb8113 (patch)
treee32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llxml
parentSecond Life viewer sources 1.18.0.6 (diff)
downloadmeta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/llxml')
-rw-r--r--linden/indra/llxml/llxmlnode.cpp11
-rw-r--r--linden/indra/llxml/llxmlnode.h4
-rw-r--r--linden/indra/llxml/llxmlparser.h4
3 files changed, 15 insertions, 4 deletions
diff --git a/linden/indra/llxml/llxmlnode.cpp b/linden/indra/llxml/llxmlnode.cpp
index bdbb606..8a267a5 100644
--- a/linden/indra/llxml/llxmlnode.cpp
+++ b/linden/indra/llxml/llxmlnode.cpp
@@ -580,11 +580,11 @@ bool LLXMLNode::parseFile(
580 fseek(fp, 0, SEEK_SET); 580 fseek(fp, 0, SEEK_SET);
581 581
582 U8* buffer = new U8[length+1]; 582 U8* buffer = new U8[length+1];
583 fread(buffer, 1, length, fp); 583 size_t nread = fread(buffer, 1, length, fp);
584 buffer[length] = 0; 584 buffer[nread] = 0;
585 fclose(fp); 585 fclose(fp);
586 586
587 bool rv = parseBuffer(buffer, length, node, defaults_tree); 587 bool rv = parseBuffer(buffer, nread, node, defaults_tree);
588 delete [] buffer; 588 delete [] buffer;
589 return rv; 589 return rv;
590} 590}
@@ -754,7 +754,10 @@ void LLXMLNode::writeToFile(FILE *fOut, LLString indent)
754 std::ostringstream ostream; 754 std::ostringstream ostream;
755 writeToOstream(ostream, indent); 755 writeToOstream(ostream, indent);
756 LLString outstring = ostream.str(); 756 LLString outstring = ostream.str();
757 fwrite(outstring.c_str(), 1, outstring.length(), fOut); 757 if (fwrite(outstring.c_str(), 1, outstring.length(), fOut) != outstring.length())
758 {
759 llwarns << "Short write" << llendl;
760 }
758} 761}
759 762
760void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& indent) 763void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& indent)
diff --git a/linden/indra/llxml/llxmlnode.h b/linden/indra/llxml/llxmlnode.h
index 3c338e2..e0e8f2f 100644
--- a/linden/indra/llxml/llxmlnode.h
+++ b/linden/indra/llxml/llxmlnode.h
@@ -30,7 +30,11 @@
30#define LL_LLXMLNODE_H 30#define LL_LLXMLNODE_H
31 31
32#define XML_STATIC 32#define XML_STATIC
33#ifdef LL_STANDALONE
34#include <expat.h>
35#else
33#include "expat/expat.h" 36#include "expat/expat.h"
37#endif
34#include <map> 38#include <map>
35 39
36#include "indra_constants.h" 40#include "indra_constants.h"
diff --git a/linden/indra/llxml/llxmlparser.h b/linden/indra/llxml/llxmlparser.h
index 307a34f..7904175 100644
--- a/linden/indra/llxml/llxmlparser.h
+++ b/linden/indra/llxml/llxmlparser.h
@@ -30,7 +30,11 @@
30#define LL_LLXMLPARSER_H 30#define LL_LLXMLPARSER_H
31 31
32#define XML_STATIC 32#define XML_STATIC
33#ifdef LL_STANDALONE
34#include <expat.h>
35#else
33#include "expat/expat.h" 36#include "expat/expat.h"
37#endif
34 38
35class LLXmlParser 39class LLXmlParser
36{ 40{