From 1dd5d458e6ccb92e6783c05a4e3090fe48084c3d Mon Sep 17 00:00:00 2001 From: Niko Rost Date: Thu, 20 Nov 2025 09:08:37 +0100 Subject: [PATCH] fixed some Error Messegas from matrixTests --- matrix.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/matrix.c b/matrix.c index df12e0b..d24b836 100644 --- a/matrix.c +++ b/matrix.c @@ -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{