summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 5190937..6b3e87e 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -1691,9 +1691,6 @@ PUGI__NS_BEGIN
assert(begin + size == end);
(void)!end;
-
- // zero-terminate
- buffer[size] = 0;
}
#ifndef PUGIXML_NO_STL
@@ -4295,6 +4292,9 @@ PUGI__NS_BEGIN
// second pass: convert to utf8
as_utf8_end(result, size, str, length);
+ // zero-terminate
+ result[size] = 0;
+
return result;
}