Replace VLA with new[].

This commit is contained in:
Andrius Štikonas 2017-06-01 01:36:38 +01:00
parent 5f0d1cd72b
commit e43d6645e4
1 changed files with 2 additions and 1 deletions

View File

@ -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());