From e1284e9efc22f554b87699294e23ad85fa64983f Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 16 Nov 2026 09:27:08 +0100 Subject: [PATCH] =?UTF-8?q?Fehlersuche=20l=C3=A4uft,=20keine=20Fortschritt?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Startcode/matrix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Startcode/matrix.c b/Startcode/matrix.c index 05e5042..3bbcc64 100644 --- a/Startcode/matrix.c +++ b/Startcode/matrix.c @@ -10,9 +10,9 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) matrix.rows = rows; matrix.cols = cols; matrix.buffer = NULL; - if (rows == 0 || cols == 0) + if (matrix.rows == 0 || matrix.cols == 0) { - return; + return matrix; } matrix.buffer = malloc(rows * cols * sizeof(MatrixType)); return matrix; @@ -21,6 +21,7 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) void clearMatrix(Matrix *matrix) { free(matrix->buffer); + matrix->buffer = NULL; } void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)