Replace VLA with new[].
This commit is contained in:
parent
5f0d1cd72b
commit
e43d6645e4
|
@ -249,10 +249,11 @@ bool LibPartedPartitionTable::clobberFileSystem(Report& report, const Partition&
|
|||
|
||||
// We need to use memset instead of = {0} because clang sucks.
|
||||
const long long zeroes_length = pedDevice()->sector_size*129;
|
||||
char zeroes[zeroes_length];
|
||||
char* zeroes = new char[zeroes_length];
|
||||
memset(zeroes, 0, zeroes_length*sizeof(char));
|
||||
|
||||
rval = ped_geometry_write(&pedPartition->geom, zeroes, 0, 129);
|
||||
delete[] zeroes;
|
||||
|
||||
if (!rval)
|
||||
report.line() << xi18nc("@info:progress", "Failed to erase filesystem signature on partition <filename>%1</filename>.", partition.deviceNode());
|
||||
|
|
Loading…
Reference in New Issue