Fixed alignment check in QJsonDocument::fromRawData

Change-Id: I1d107e26a77e40f91ff09d43e9529b08da8f7c3b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Denis Dzyubenko 2012-02-08 23:01:05 +01:00 committed by Qt by Nokia
parent 1406659948
commit 9633459274

View File

@ -179,8 +179,8 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other)
*/
QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation)
{
if (!(((quintptr)validation) & ~3)) {
qWarning() <<"QJsonDocumnt::fromRawData: data has to have 4 byte alignment";
if (quintptr(data) & 3) {
qWarning() <<"QJsonDocument::fromRawData: data has to have 4 byte alignment";
return QJsonDocument();
}