Fixed: Avoid zero-length array that is written to (caused crash on clang)

This commit is contained in:
Knut Morten Okstad 2016-12-13 16:32:55 +01:00
parent 1a43e1c694
commit 4e8fa1ede4

View File

@ -1893,8 +1893,8 @@ void SIMbase::printSolutionSummary (const Vector& solution, int printSol,
{
// Compute and print solution norms
const size_t nf = this->getNoFields(1);
size_t iMax[nf];
double dMax[nf];
size_t iMax[nf > 0 ? nf : nsd];
double dMax[nf > 0 ? nf : nsd];
double dNorm = this->solutionNorms(solution,dMax,iMax,nf);
int oldPrec = adm.cout.precision();