aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llxml/llxmlnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llxml/llxmlnode.cpp11
1 files changed, 7 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)