Revert "Fix mix of new[] / malloc in QTest::toHexRepresentation"
This reverts commit e8f73d656cf13d440a3a83980e05c6b117489e40. The original was correct: qtestcase.cpp:282 and 283 use delete[]. Change-Id: I668e17f500edcf9f1406553a160f6f5518dee148 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
e20147d1d0
commit
89bb20b937
|
|
@ -1893,7 +1893,7 @@ char *toHexRepresentation(const char *ba, int length)
|
|||
|
||||
if (length > maxLen) {
|
||||
const int size = len * 3 + 4;
|
||||
result = static_cast<char *>(malloc(size));
|
||||
result = new char[size];
|
||||
|
||||
char *const forElipsis = result + size - 5;
|
||||
forElipsis[0] = ' ';
|
||||
|
|
@ -1901,9 +1901,10 @@ char *toHexRepresentation(const char *ba, int length)
|
|||
forElipsis[2] = '.';
|
||||
forElipsis[3] = '.';
|
||||
result[size - 1] = '\0';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
const int size = len * 3;
|
||||
result = static_cast<char *>(malloc(size));
|
||||
result = new char[size];
|
||||
result[size - 1] = '\0';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue