summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-02-01 11:06:52 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-16 21:15:27 +0100
commit4d1ad4e4d386b2afb29e8476e21dc8f38262d238 (patch)
tree131baccbd17108c659d30bcb6393513b942426fe
parent0ebca8f46fdfb8c99926cf28717b62c8cd741858 (diff)
Don't treat QByteArray(0, char) as null
This also changes behavior for negative sizes, but those cases could be viewed as errors on the client side, anyway. Change-Id: I9e56f2ba53b1edcd9f2faa5384c7d77f6823e24a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/dbus/qdbusmetatype.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index ac936b1d0a..ea6f5c4626 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1338,7 +1338,7 @@ QByteArray::QByteArray(const char *data, int size)
QByteArray::QByteArray(int size, char ch)
{
if (size <= 0) {
- d = const_cast<Data *>(&shared_null.ba);
+ d = const_cast<Data *>(&shared_empty.ba);
} else {
d = static_cast<Data *>(malloc(sizeof(Data) + size + 1));
Q_CHECK_PTR(d);
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index b5a138f654..0359b4da35 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE
class QDBusCustomTypeInfo
{
public:
- QDBusCustomTypeInfo() : signature(0, '\0'), marshall(0), demarshall(0)
+ QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0)
{ }
// Suggestion: