generated from freudenreichan/info2Praktikum-NeuronalesNetz
First error fixing in createMatrix()
This commit is contained in:
parent
94a69b0068
commit
04493332f7
5
matrix.c
5
matrix.c
@ -10,7 +10,10 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
|
|||||||
Matrix newMatrix;
|
Matrix newMatrix;
|
||||||
newMatrix.rows = rows;
|
newMatrix.rows = rows;
|
||||||
newMatrix.cols = cols;
|
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;
|
return newMatrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user