From f5cbeabb9b56442fef56009e0cde2242fd7e0f48 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sat, 28 Aug 2010 13:52:29 +0000 Subject: [PATCH] Copy string metadata properly --- src/core/utilities.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/utilities.h b/src/core/utilities.h index 1d6c867c2..70d0702b5 100644 --- a/src/core/utilities.h +++ b/src/core/utilities.h @@ -46,7 +46,7 @@ public: operator wchar_t*() const { return get(); } int characters() const { return chars_; } - int bytes() const { return chars_ * sizeof(wchar_t) + 1; } + int bytes() const { return (chars_ + 1) * sizeof(wchar_t); } private: Q_DISABLE_COPY(ScopedWCharArray);