bug fix in create matrix

This commit is contained in:
AD005\z0046beb 2025-11-12 11:44:26 +01:00
parent b661866a16
commit 4aee809756

View File

@ -14,8 +14,11 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
if(rows == 0 || cols == 0)
{
printf("Error");
exit(EXIT_FAILURE);
m.rows = 0;
m.cols = 0;
m.buffer = NULL;
return m;
}
m.buffer = calloc(rows * cols, sizeof(MatrixType));