diff --git a/matrix.c b/matrix.c index b6dcaca..e430469 100644 --- a/matrix.c +++ b/matrix.c @@ -13,15 +13,15 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) if(rows == 0 || cols == 0) { - return m; + printf("Error"); + exit(EXIT_FAILURE); } m.data = calloc(rows * cols, sizeof(MatrixType)); if (m.data == NULL) { - m.rows = 0; - m.cols = 0; - return m; + printf("Error"); + exit(EXIT_FAILURE); } return m;