fixed some Error Messegas from matrixTests

This commit is contained in:
Niko Rost 2025-11-20 09:08:37 +01:00
parent 4640908e1b
commit 1dd5d458e6

View File

@ -23,8 +23,8 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
void clearMatrix(Matrix *matrix)
{
free(matrix.buffer);
matrix.buffer = NULL;
free(matrix->buffer);
matrix->buffer = NULL;
}
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
@ -55,8 +55,7 @@ Matrix add(const Matrix matrix1, const Matrix matrix2)
Matrix MatrixErgebnis = createMatrix(matrix1.rows, matrix1.cols); //Creating Result Matrix
if(matrix1.cols != matrix2.cols || matrix1.rows != matrix2.rows){
printf("Matrix dimensions do not match\n"); //Error Message if dimensions of Input Matrixes are not identical
clearMatrix(MatrixErgebnis);
MatrixErgebnis = NULL;
clearMatrix(&MatrixErgebnis);
return MatrixErgebnis;
}
else{