summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xmlreader/span.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/xmlreader/span.hxx b/include/xmlreader/span.hxx
index 5e85cd0d5595..b44c0eb61adc 100644
--- a/include/xmlreader/span.hxx
+++ b/include/xmlreader/span.hxx
@@ -50,8 +50,10 @@ struct OOO_DLLPUBLIC_XMLREADER Span {
inline bool is() const { return begin != 0; }
inline bool equals(Span const & text) const {
- return rtl_str_compare_WithLength(
- begin, length, text.begin, text.length) == 0;
+ return length == text.length
+ && (rtl_str_compare_WithLength(
+ begin, length, text.begin, text.length)
+ == 0);
}
inline bool equals(char const * textBegin, sal_Int32 textLength) const {