summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rtl/stringconcat.hxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index e2cba5d86f0d..7f55d6c3473d 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -74,14 +74,18 @@ struct ToStringHelper
inline
char* addDataHelper( char* buffer, const char* data, std::size_t length )
{
- memcpy( buffer, data, length );
+ if (length != 0) {
+ memcpy( buffer, data, length );
+ }
return buffer + length;
}
inline
sal_Unicode* addDataHelper( sal_Unicode* buffer, const sal_Unicode* data, std::size_t length )
{
- memcpy( buffer, data, length * sizeof( sal_Unicode ));
+ if (length != 0) {
+ memcpy( buffer, data, length * sizeof( sal_Unicode ));
+ }
return buffer + length;
}