Fix wrong order of arguments in calloc

This commit is contained in:
Carles Fernandez 2024-04-22 09:48:28 +02:00
parent c6010d943e
commit c91c31bd35
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
1 changed files with 1 additions and 1 deletions

View File

@ -1034,7 +1034,7 @@ double *zeros(int n, int m)
{
return nullptr;
}
if (!(p = static_cast<double *>(calloc(sizeof(double), n * m))))
if (!(p = static_cast<double *>(calloc(n * m, sizeof(double)))))
{
fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m);
}