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>
This commit is contained in:
parent
0ebca8f46f
commit
4d1ad4e4d3
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user