From d373dcc7cbed5fdea72c6b71a5594e4e85549b43 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 20 Jul 2007 20:38:05 +0000 Subject: svn merge -r 64548:64837 svn+ssh://svn/svn/linden/branches/maintenance into release * WARNING *: maintenance r64837 is not the last rev to use in the next merge. use r65269 --- indra/llxml/llxmlnode.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index 29e7214020..de4c7981e8 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -560,11 +560,11 @@ bool LLXMLNode::parseFile( fseek(fp, 0, SEEK_SET); U8* buffer = new U8[length+1]; - fread(buffer, 1, length, fp); - buffer[length] = 0; + size_t nread = fread(buffer, 1, length, fp); + buffer[nread] = 0; fclose(fp); - bool rv = parseBuffer(buffer, length, node, defaults_tree); + bool rv = parseBuffer(buffer, nread, node, defaults_tree); delete [] buffer; return rv; } @@ -734,7 +734,10 @@ void LLXMLNode::writeToFile(FILE *fOut, LLString indent) std::ostringstream ostream; writeToOstream(ostream, indent); LLString outstring = ostream.str(); - fwrite(outstring.c_str(), 1, outstring.length(), fOut); + if (fwrite(outstring.c_str(), 1, outstring.length(), fOut) != outstring.length()) + { + llwarns << "Short write" << llendl; + } } void LLXMLNode::writeToOstream(std::ostream& output_stream, const LLString& indent) -- cgit v1.2.3