generated from freudenreichan/info2Praktikum-NeuronalesNetz
First error fixing in createMatrix()
This commit is contained in:
@@ -10,7 +10,10 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
||||
Matrix newMatrix;
|
||||
newMatrix.rows = rows;
|
||||
newMatrix.cols = cols;
|
||||
newMatrix.buffer = calloc(rows*cols, sizeof(MatrixType));
|
||||
if (rows == 0 || cols == 0)
|
||||
newMatrix.buffer = NULL;
|
||||
else
|
||||
newMatrix.buffer = calloc(rows*cols, sizeof(MatrixType));
|
||||
return newMatrix;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user