summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-03-05 11:35:39 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-03-05 11:35:39 -0800
commit9749920c8204930f868fed7fcf38ea2cc2b5a2ec (patch)
treefb2ee688dcdae6b3ef24ce18017639e42f75a7c3 /src/pugixml.cpp
parent57ca94f89722937e8eb33537b0f290928d92bb7d (diff)
Refactor contents=0 behavior
Also change the error code to status_io_error
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 787f693..fa41058 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -4316,12 +4316,7 @@ PUGI__NS_BEGIN
PUGI__FN xml_parse_result load_buffer_impl(xml_document_struct* doc, xml_node_struct* root, void* contents, size_t size, unsigned int options, xml_encoding encoding, bool is_mutable, bool own, char_t** out_buffer)
{
// check input buffer
- if ((contents==NULL) && (size!=0)) {
- xml_parse_result result;
- result.status = status_no_document_element;
- return result;
- }
-
+ if (!contents && size) return make_parse_result(status_io_error);
// get actual encoding
xml_encoding buffer_encoding = impl::get_buffer_encoding(encoding, contents, size);