diff options
author | Don Kjer <don@lindenlab.com> | 2007-07-20 20:38:05 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-07-20 20:38:05 +0000 |
commit | d373dcc7cbed5fdea72c6b71a5594e4e85549b43 (patch) | |
tree | 140e20f48db5dc4d7842f05ef2c24ef9e6fc3238 /indra/llxml | |
parent | c78f99b0b3b4b9ac99a69b63315e821d89a89a3b (diff) |
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
Diffstat (limited to 'indra/llxml')
-rw-r--r-- | indra/llxml/llxmlnode.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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) |