diff options
Diffstat (limited to 'sal/inc/rtl/ustring.hxx')
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 534bd889f05a..ec9f90ecd46f 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -330,9 +330,12 @@ public: const int l = c.length(); rtl_uString* buffer = NULL; rtl_uString_new_WithLength( &buffer, l ); // TODO this clears, not necessary - sal_Unicode* end = c.addData( buffer->buffer ); - buffer->length = end - buffer->buffer; - // TODO realloc in case buffer->length is noticeably smaller than l ? + if (l != 0) + { + sal_Unicode* end = c.addData( buffer->buffer ); + buffer->length = end - buffer->buffer; + // TODO realloc in case buffer->length is noticeably smaller than l? + } pData = buffer; } #endif |