Don't pass invalid strings to strcmp()
The address behind a string doesn't point to a string. Change-Id: Ic54f652ae781fea278f60cc49d219c1c610ba29f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
parent
c7dddf2ae5
commit
24013d8a87
@ -1561,7 +1561,7 @@ void tst_QArrayData::literals()
|
||||
#endif
|
||||
|
||||
QVERIFY(v.isSharable());
|
||||
QCOMPARE((const char *)(v.constBegin() + v.size()), (const char *)v.constEnd());
|
||||
QCOMPARE((void*)(v.constBegin() + v.size()), (void*)v.constEnd());
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
QCOMPARE(const_(v)[i], char('A' + i));
|
||||
|
Loading…
Reference in New Issue
Block a user